From d05f3be54f619575769eaf7f00edff9f99feb6f6 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Mon, 28 Aug 2017 21:39:07 -0600 Subject: Avoid use after destruction --- common/log.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'common/log.cpp') 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); QSet Sink::Log::debugAreas() { - return sDebugAreaCollector->debugAreas(); + if (!sDebugAreaCollector.isDestroyed()) { + return sDebugAreaCollector->debugAreas(); + } + return {}; } static void collectDebugArea(const QString &debugArea) { - sDebugAreaCollector->add(debugArea); + if (!sDebugAreaCollector.isDestroyed()) { + sDebugAreaCollector->add(debugArea); + } } static bool containsItemStartingWith(const QByteArray &pattern, const QByteArrayList &list) -- cgit v1.2.3