summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel
diff options
context:
space:
mode:
authorMichal Klocek <michal.klocek@qt.io>2020-03-12 17:07:08 +0100
committerMichal Klocek <michal.klocek@qt.io>2020-03-25 14:40:32 +0000
commitb1e3f33a28aad1d9386ff2ef569db90341a8d68a (patch)
tree480ae3bc1e4e718e31221a3ad9919155b860e0bf /src/gui/kernel
parente63d2272895ea5178f0704546dc5b5deed4b1b39 (diff)
Call post routines from ~QGuiApplication
Currently depending if user uses QApplication or QGuiApplication we end up in different behavior when running post routines. For example QApplication destructor calls post routines before stopping event dispatcher, In case of QGuiApplication post routines are called from QCoreApplication destructor, so no more event dispatcher. This behavior is not consistent and creates troubles when releasing resources of web engine. Attached test will hang on windows with QGuiApplication, however works fine with QApplication. Task-number: QTBUG-79864 Change-Id: Ice05e66a467feaf3ad6addfbc14973649da8065e Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/gui/kernel')
-rw-r--r--src/gui/kernel/qguiapplication.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp
index 469563c415..b9e8db8789 100644
--- a/src/gui/kernel/qguiapplication.cpp
+++ b/src/gui/kernel/qguiapplication.cpp
@@ -134,6 +134,7 @@ QT_BEGIN_NAMESPACE
return __VA_ARGS__; \
}
+Q_CORE_EXPORT void qt_call_post_routines();
Q_GUI_EXPORT bool qt_is_gui_used = true;
Qt::MouseButtons QGuiApplicationPrivate::mouse_buttons = Qt::NoButton;
@@ -678,6 +679,8 @@ QGuiApplication::~QGuiApplication()
{
Q_D(QGuiApplication);
+ qt_call_post_routines();
+
d->eventDispatcher->closingDown();
d->eventDispatcher = nullptr;