Fix memory corruption due to concurrent QString operations

This commit is contained in:
Cameron Gutman 2025-10-24 23:38:07 -05:00
commit b1232e0ed4

View file

@ -96,7 +96,7 @@ void logToLoggerStream(QString& message)
#if defined(QT_DEBUG) && defined(Q_OS_WIN32)
// Output log messages to a debugger if attached
if (IsDebuggerPresent()) {
static QString lineBuffer;
thread_local QString lineBuffer;
lineBuffer += message;
if (message.endsWith('\n')) {
OutputDebugStringW(lineBuffer.toStdWString().c_str());