From 0aeaa37a0fcd4c598487f4fed9db28bc1d135861 Mon Sep 17 00:00:00 2001 From: zhanghongyuan Date: Wed, 30 Sep 2026 14:13:26 +0800 Subject: [PATCH] fix: don't dispatch events while closing - QCoreApplication: don't dispatch events while closing log: don't dispatch events while closing --- debian/changelog | 6 ++++ ...do-not-dispatch-events-while-closing.patch | 36 +++++++++++++++++++ debian/patches/series | 1 + 3 files changed, 43 insertions(+) create mode 100644 debian/patches/Fix-do-not-dispatch-events-while-closing.patch diff --git a/debian/changelog b/debian/changelog index 522a2faf..34c3aa0f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +qt6-base (6.8.0+dfsg-0deepin38) unstable; urgency=medium + + * Fix don't dispatch events while closing + + -- zhanghongyuan Wed, 30 Sep 2026 14:12:52 +0800 + qt6-base (6.8.0+dfsg-0deepin37) unstable; urgency=medium * Fix crash when fontconfig fallback pattern has no charset. diff --git a/debian/patches/Fix-do-not-dispatch-events-while-closing.patch b/debian/patches/Fix-do-not-dispatch-events-while-closing.patch new file mode 100644 index 00000000..d49a471c --- /dev/null +++ b/debian/patches/Fix-do-not-dispatch-events-while-closing.patch @@ -0,0 +1,36 @@ +Author: zhanghongyuan +Date: Wed, 30 Sep 2026 14:04:31 +0800 +Subject: QCoreApplication: don't dispatch events while closing +Upstream: https://codereview.qt-project.org/c/qt/qtbase/+/773760 + +--- + +Index: qt6-base/src/corelib/kernel/qcoreapplication.cpp +=================================================================== +--- qt6-base.orig/src/corelib/kernel/qcoreapplication.cpp ++++ qt6-base/src/corelib/kernel/qcoreapplication.cpp +@@ -958,12 +958,13 @@ QCoreApplication::~QCoreApplication() + + qt_call_post_routines(); + +- self = nullptr; + #ifndef QT_NO_QOBJECT + QCoreApplicationPrivate::is_app_closing = true; + QCoreApplicationPrivate::is_app_running = false; + #endif + ++ self = nullptr; ++ + #if QT_CONFIG(thread) + // Synchronize and stop the global thread pool threads. + QThreadPool *globalThreadPool = nullptr; +@@ -1157,6 +1158,9 @@ bool QCoreApplication::notifyInternal2(Q + QScopedScopeLevelCounter scopeLevelCounter(threadData); + if (!selfRequired) + return doNotify(receiver, event); ++ ++ if (QCoreApplicationPrivate::is_app_closing) ++ return false; // no event delivery while the application is closing + + #if QT_VERSION >= QT_VERSION_CHECK(7, 0, 0) + if (threadData->thread.loadRelaxed() != QCoreApplicationPrivate::mainThread()) diff --git a/debian/patches/series b/debian/patches/series index 4ce9c938..5d15a8a8 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -60,3 +60,4 @@ CVE-2026-78253_fix-stack-exhaustion-in-readElementText.patch CVE-2026-82292_guard-against-null-nodes-in-QDomBuilder.patch fix-ComboBox-Wheelevent.patch Fix-crash-when-fontconfig-fallback-pattern-has-no-charset.patch +Fix-do-not-dispatch-events-while-closing.patch