diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2023-10-12 09:13:02 -0700 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2024-05-07 14:22:27 -0700 |
commit | 1ed0dd88a32cd2c5ae100b48e14ff55bcbb652e6 (patch) | |
tree | 5173b160b09f9980ce146f1645cb85dc702a3033 /src/widgets/doc/images/widget-examples.png | |
parent | 3fc5ee5c2e4ed919b2939ca54a1958b8463eb404 (diff) |
QThread/Unix: make QThreadPrivate::finish() be called much later
We need it to run after all the thread-local destructors have run, to
ensure that some user code hasn't run after QThreadPrivate::finish() has
finished. We achieve that by making it get called from a thread-local
destructor itself, in the form of a qScopeGuard.
This ought to have been done since C++11 thread_local with non-trivial
destructors became available. However, it only started showing up after
commit 4a93285b166ceceaea2e10c8fc6a254d2f7093b9 began using thread_local
inside Qt itself. The visible symptom was that QThreadPrivate::finish()
had already destroyed the thread's event dispatcher, but some user code
ran later and expected it to still exist (or, worse, recreated it, via
QEventLoop → QThreadData::ensureEventDispatcher).
Fixes: QTBUG-117996
Pick-to: 6.7
Change-Id: I8f3ce163ccc5408cac39fffd178d682e5bfa6955
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/widgets/doc/images/widget-examples.png')
0 files changed, 0 insertions, 0 deletions