From b1e3f33a28aad1d9386ff2ef569db90341a8d68a Mon Sep 17 00:00:00 2001 From: Michal Klocek Date: Thu, 12 Mar 2020 17:07:08 +0100 Subject: Call post routines from ~QGuiApplication MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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ø --- src/gui/kernel/qguiapplication.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/gui/kernel') 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; -- cgit v1.2.3