diff options
author | Liang Qi <liang.qi@qt.io> | 2018-11-10 11:36:18 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2018-11-10 11:38:40 +0100 |
commit | 58437fb125f60c11ba8e97c914fa8db8c89c7373 (patch) | |
tree | f47ed59073984ec76034155bc04d3d987b192d2e /src/corelib/tools/qsharedpointer.cpp | |
parent | 76bb804405f424708fffec502788995ea91206b8 (diff) | |
parent | b20c15f2041205a1cab98fbaf9560a3e2e0d6367 (diff) |
Merge remote-tracking branch 'origin/5.12' into dev
Conflicts:
src/corelib/serialization/qcborcommon.h
src/corelib/tools/qlocale_data_p.h
tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp
Done-with: Edward Welbourne <edward.welbourne@qt.io>
Change-Id: Ibed987f6d77a0294f78f67d78625237616082416
Diffstat (limited to 'src/corelib/tools/qsharedpointer.cpp')
-rw-r--r-- | src/corelib/tools/qsharedpointer.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/corelib/tools/qsharedpointer.cpp b/src/corelib/tools/qsharedpointer.cpp index e58d3ab6bc..622b03f42d 100644 --- a/src/corelib/tools/qsharedpointer.cpp +++ b/src/corelib/tools/qsharedpointer.cpp @@ -1384,6 +1384,9 @@ QtSharedPointer::ExternalRefCountData *QtSharedPointer::ExternalRefCountData::ge x->strongref.store(-1); x->weakref.store(2); // the QWeakPointer that called us plus the QObject itself if (!d->sharedRefcount.testAndSetRelease(0, x)) { + // ~ExternalRefCountData has a Q_ASSERT, so we use this trick to + // only execute this if Q_ASSERTs are enabled + Q_ASSERT((x->weakref.store(0), true)); delete x; x = d->sharedRefcount.loadAcquire(); x->weakref.ref(); |