瀏覽代碼

QsLog: add missing lock

The destList is accessed both from the main thread and logger's writer
thread.

Within PMP, this shouldn't matter in practice, because we're not adding
new destinations after sending the first log message.
Vincent Lang 8 年之前
父節點
當前提交
5b778a35ce
共有 1 個文件被更改,包括 1 次插入0 次删除
  1. 1 0
      external/qslog/QsLog.cpp

+ 1 - 0
external/qslog/QsLog.cpp

@@ -187,6 +187,7 @@ Logger::~Logger()
 
 void Logger::addDestination(DestinationPtr destination)
 {
+    QMutexLocker lock(&d->logMutex);
     assert(destination.data());
     d->destList.push_back(destination);
 }