diff options
Diffstat (limited to 'common/log.cpp')
-rw-r--r-- | common/log.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/common/log.cpp b/common/log.cpp index 5156a23..e5ed29b 100644 --- a/common/log.cpp +++ b/common/log.cpp | |||
@@ -253,14 +253,22 @@ class DebugAreaCollector { | |||
253 | public: | 253 | public: |
254 | DebugAreaCollector() | 254 | DebugAreaCollector() |
255 | { | 255 | { |
256 | QMutexLocker locker(&mutex); | 256 | //This call can potentially print a log message (if we fail to remove the qsettings lockfile), which would result in a deadlock if we locked over all of it. |
257 | mDebugAreas = debugAreasConfig()->value("areas").value<QString>().split(';').toSet(); | 257 | const auto areas = debugAreasConfig()->value("areas").value<QString>().split(';').toSet(); |
258 | { | ||
259 | QMutexLocker locker(&mutex); | ||
260 | mDebugAreas = areas; | ||
261 | } | ||
258 | } | 262 | } |
259 | 263 | ||
260 | ~DebugAreaCollector() | 264 | ~DebugAreaCollector() |
261 | { | 265 | { |
262 | QMutexLocker locker(&mutex); | 266 | //This call can potentially print a log message (if we fail to remove the qsettings lockfile), which would result in a deadlock if we locked over all of it. |
263 | mDebugAreas += debugAreasConfig()->value("areas").value<QString>().split(';').toSet(); | 267 | const auto areas = debugAreasConfig()->value("areas").value<QString>().split(';').toSet(); |
268 | { | ||
269 | QMutexLocker locker(&mutex); | ||
270 | mDebugAreas += areas; | ||
271 | } | ||
264 | debugAreasConfig()->setValue("areas", QVariant::fromValue(mDebugAreas.toList().join(';'))); | 272 | debugAreasConfig()->setValue("areas", QVariant::fromValue(mDebugAreas.toList().join(';'))); |
265 | } | 273 | } |
266 | 274 | ||