Make sure QThreadData and QAdoptedThread object is destroyed at app exit
Task-number: QTBUG-30134
Restore the lines in qcoreapplication.cpp removed by commit
950b35cf97
to ensure QThreadData and
QAdoptedThread object of main thread is destroyed at application exit.
We don't set QCoreApplicationPriavte::theMainThread to 0 as before since
it will be set to zero in QThreadData::~QThreadData()
Change-Id: I8ee56aff5a933ce1d812b07fb00a29ed0839ab6e
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
parent
0c7e6ac083
commit
7dc622290b
@ -317,6 +317,13 @@ struct QCoreApplicationData {
|
||||
~QCoreApplicationData() {
|
||||
#ifndef QT_NO_LIBRARY
|
||||
delete app_libpaths;
|
||||
#endif
|
||||
#ifndef QT_NO_QOBJECT
|
||||
// cleanup the QAdoptedThread created for the main() thread
|
||||
if (QCoreApplicationPrivate::theMainThread) {
|
||||
QThreadData *data = QThreadData::get2(QCoreApplicationPrivate::theMainThread);
|
||||
data->deref(); // deletes the data and the adopted thread
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user