summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2021-11-08 16:57:24 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-11-09 12:41:27 +0000
commit0fb4e97f3837d7c1802a28c5f728effb788f6cc5 (patch)
treeca387f76d71d2036fee63a8b2cfdda96abf48e77 /src
parent9f62d88ff97e594cbb61f83daa45f8d7b6651425 (diff)
Don't quit application if we're not in exec
The documentation states that the function will not have any effect before control enters the main event loop. Prior to 0c02f133f3daee1 this was incidentally true due to QCoreApplication::exit just setting quitNow to true and exiting all the event loops (which before exec were none), and exec() setting quitNow to false explicitly. But now that we plumb the quit down to the platform we can't rely on this incidental behavior, and need to check explicitly. Fixes: QTBUG-98088 Change-Id: I54cece3630e39e4456abc3b372839c0b5c4c4713 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> (cherry picked from commit 851ed6f0b1014e5acabdc1f977979841d16ecc31) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src')
-rw-r--r--src/corelib/kernel/qcoreapplication.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp
index 61bc795a23..a2f227ee5a 100644
--- a/src/corelib/kernel/qcoreapplication.cpp
+++ b/src/corelib/kernel/qcoreapplication.cpp
@@ -2018,6 +2018,9 @@ void QCoreApplication::quit()
if (!self)
return;
+ if (!self->d_func()->in_exec)
+ return;
+
self->d_func()->quit();
}