summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2017-08-28 21:39:07 -0600
committerChristian Mollekopf <chrigi_1@fastmail.fm>2017-08-28 21:39:07 -0600
commitd05f3be54f619575769eaf7f00edff9f99feb6f6 (patch)
tree6428505446bf40152fda11710fd72727dca62586 /common
parentbe19bfef2d04943aa17b3f719f50f34f647c4eeb (diff)
downloadsink-d05f3be54f619575769eaf7f00edff9f99feb6f6.tar.gz
sink-d05f3be54f619575769eaf7f00edff9f99feb6f6.zip
Avoid use after destruction
Diffstat (limited to 'common')
-rw-r--r--common/log.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/common/log.cpp b/common/log.cpp
index 3edc89a..ac87c84 100644
--- a/common/log.cpp
+++ b/common/log.cpp
@@ -270,12 +270,17 @@ Q_GLOBAL_STATIC(DebugAreaCollector, sDebugAreaCollector);
270 270
271QSet<QString> Sink::Log::debugAreas() 271QSet<QString> Sink::Log::debugAreas()
272{ 272{
273 return sDebugAreaCollector->debugAreas(); 273 if (!sDebugAreaCollector.isDestroyed()) {
274 return sDebugAreaCollector->debugAreas();
275 }
276 return {};
274} 277}
275 278
276static void collectDebugArea(const QString &debugArea) 279static void collectDebugArea(const QString &debugArea)
277{ 280{
278 sDebugAreaCollector->add(debugArea); 281 if (!sDebugAreaCollector.isDestroyed()) {
282 sDebugAreaCollector->add(debugArea);
283 }
279} 284}
280 285
281static bool containsItemStartingWith(const QByteArray &pattern, const QByteArrayList &list) 286static bool containsItemStartingWith(const QByteArray &pattern, const QByteArrayList &list)