From 166ec94f2778425d5b6de9a2e10c96c8794b1286 Mon Sep 17 00:00:00 2001 From: Felix Hufnagel Date: Tue, 17 Oct 2023 16:36:44 +0200 Subject: [PATCH] Update qpromise_p.h BUGFIX: prevent events calling functions after qcoreapp shutdown. --- src/qtpromise/qpromise_p.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qtpromise/qpromise_p.h b/src/qtpromise/qpromise_p.h index 2b5e674..cb75ada 100644 --- a/src/qtpromise/qpromise_p.h +++ b/src/qtpromise/qpromise_p.h @@ -55,7 +55,7 @@ static void qtpromise_defer(F&& f, const QPointer& thread) { Event(FType&& f) : QEvent{QEvent::None}, m_f{std::move(f)} { } Event(const FType& f) : QEvent{QEvent::None}, m_f{f} { } - ~Event() override { m_f(); } + ~Event() override { if (!QCoreApplication::closingDown()) {m_f();} } FType m_f; };