summaryrefslogtreecommitdiffstats
path: root/src/testlib
diff options
context:
space:
mode:
Diffstat (limited to 'src/testlib')
-rw-r--r--src/testlib/qtestlog.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/testlib/qtestlog.cpp b/src/testlib/qtestlog.cpp
index 29cafe9aea4..f3db4ece49e 100644
--- a/src/testlib/qtestlog.cpp
+++ b/src/testlib/qtestlog.cpp
@@ -305,9 +305,7 @@ namespace QTest {
{
static QBasicAtomicInt counter = Q_BASIC_ATOMIC_INITIALIZER(QTest::maxWarnings);
- auto loggerCapture = loggers->allLoggers();
-
- if (loggerCapture.isEmpty()) {
+ if (loggers.isDestroyed() || loggers->allLoggers().isEmpty()) {
// the message handler may be called from a worker thread, after the main thread stopped
// logging. Forwarding to original message handler to avoid swallowing the message
Q_ASSERT(oldMessageHandler);
@@ -326,6 +324,8 @@ namespace QTest {
return;
}
+ auto loggerCapture = loggers->allLoggers();
+
if (type != QtFatalMsg) {
if (counter.loadRelaxed() <= 0)
return;