diff options
author | Liang Qi <liang.qi@qt.io> | 2017-11-05 17:58:48 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2017-11-05 18:02:18 +0100 |
commit | a7e4b645dc5b164eb31c22b558ae7a2f5b674afb (patch) | |
tree | c58ac922346363c265ad6873cefe9ed205d84a1d /src/corelib/thread | |
parent | cd542a82b0c2d5c9a4ea167a84e5ea8a25c5d969 (diff) | |
parent | ea0e868c4881944207e9b3a77011e05a505ff3b7 (diff) |
Merge remote-tracking branch 'origin/5.10' into dev
Conflicts:
src/corelib/global/minimum-linux.S
src/network/access/qhttpthreaddelegate.cpp
src/widgets/kernel/qwidgetwindow.cpp
Change-Id: Id2e817e85f85c68f5482c9a12912d35590f9d5f8
Diffstat (limited to 'src/corelib/thread')
-rw-r--r-- | src/corelib/thread/qthread.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/corelib/thread/qthread.cpp b/src/corelib/thread/qthread.cpp index e92be64dfa..cad7a14017 100644 --- a/src/corelib/thread/qthread.cpp +++ b/src/corelib/thread/qthread.cpp @@ -78,6 +78,13 @@ QThreadData::~QThreadData() QThreadData::clearCurrentThreadData(); } + // ~QThread() sets thread to nullptr, so if it isn't null here, it's + // because we're being run before the main object itself. This can only + // happen for QAdoptedThread. Note that both ~QThreadPrivate() and + // ~QObjectPrivate() will deref this object again, but that is acceptable + // because this destructor is still running (the _ref sub-object has not + // been destroyed) and there's no reentrancy. The refcount will become + // negative, but that's acceptable. QThread *t = thread; thread = 0; delete t; |