mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2026-06-19 07:01:02 +00:00
Fix memory corruption due to concurrent QString operations
This commit is contained in:
+1
-1
@@ -96,7 +96,7 @@ void logToLoggerStream(QString& message)
|
|||||||
#if defined(QT_DEBUG) && defined(Q_OS_WIN32)
|
#if defined(QT_DEBUG) && defined(Q_OS_WIN32)
|
||||||
// Output log messages to a debugger if attached
|
// Output log messages to a debugger if attached
|
||||||
if (IsDebuggerPresent()) {
|
if (IsDebuggerPresent()) {
|
||||||
static QString lineBuffer;
|
thread_local QString lineBuffer;
|
||||||
lineBuffer += message;
|
lineBuffer += message;
|
||||||
if (message.endsWith('\n')) {
|
if (message.endsWith('\n')) {
|
||||||
OutputDebugStringW(lineBuffer.toStdWString().c_str());
|
OutputDebugStringW(lineBuffer.toStdWString().c_str());
|
||||||
|
|||||||
Reference in New Issue
Block a user