Details
-
Bug
-
Resolution: Done
-
Not Evaluated
-
5.0.0
-
None
-
windows 7 x64 sp1
vs2010 sp1
-
91cf813c816582188ef8943b29338c3db06d1133 (4.8)
Description
adopted thread watcher is responsible for clean up thread data of all other adopted thread, but it can not clean up the thread data of its own.
qt_adopted_thread_watcher_function() will call the following functions to finish an exited adopted thread:
thread_p->finish(thread); --> QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete); --> QThreadData *data = QThreadData::current();
As a result of this, adopted thread wather will create its own thread data and its own QAdoptedThread object in QThreadData::current(); and add it to the watch list. Thus the adopted thread watcher thread can't exit because the only exit condition is "qt_adopted_thread_handles.count() == 1" which will never meet. Thus the adopted thread wather's thread data can't be cleaned up and the watcher thread also can't exit.