diff options
author | André Klitzing <aklitzing@gmail.com> | 2020-05-19 12:50:35 +0200 |
---|---|---|
committer | André Klitzing <aklitzing@gmail.com> | 2020-06-23 08:31:00 +0200 |
commit | 1304040e5d5af0575cac43aaf1424f72472c7b23 (patch) | |
tree | 25a3f6e5bb6f1364c73dd8e293e8b89ea9130e82 /src/corelib/kernel/qcoreapplication.cpp | |
parent | 727fab7d291d8d6e1b61a7faec4b4318f714d1e0 (diff) |
Fix living QObject after shutdown of QCoreApplication
QThreadPool is a QObject and must be deleted if the QCoreApplication
is being destroyed to release the underlying ThreadData.
A Q_GLOBAL_STATIC won't release any memory is not able to
manually release it.
Pick-to: 5.15
Task-number: QTBUG-84234
Change-Id: Ia82bcff2b564b753ed687f025ff86fa1bed1e64c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/kernel/qcoreapplication.cpp')
-rw-r--r-- | src/corelib/kernel/qcoreapplication.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp index 87e5d89350..2894e1a731 100644 --- a/src/corelib/kernel/qcoreapplication.cpp +++ b/src/corelib/kernel/qcoreapplication.cpp @@ -892,8 +892,10 @@ QCoreApplication::~QCoreApplication() } QT_CATCH (...) { // swallow the exception, since destructors shouldn't throw } - if (globalThreadPool) + if (globalThreadPool) { globalThreadPool->waitForDone(); + delete globalThreadPool; + } #endif #ifndef QT_NO_QOBJECT |