diff options
| author | Bradley T. Hughes <bradley.hughes@nokia.com> | 2011-09-29 11:50:08 +0200 |
|---|---|---|
| committer | Qt by Nokia <qt-info@nokia.com> | 2011-10-27 18:57:38 +0200 |
| commit | 6476ac738ca029af95932f53b53f0705808eb80e (patch) | |
| tree | d1884397040eb65d23a48a0e1a56dad3f476cf34 /src/corelib/kernel/qobject.cpp | |
| parent | 434824aede28e8c36d6991aa218f89daf2cc22fa (diff) | |
Replace implicit QAtomic* casts with explicit load()/store()
Change-Id: Ia7ef1a8e01001f203e409c710c977d6f4686342e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/kernel/qobject.cpp')
| -rw-r--r-- | src/corelib/kernel/qobject.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp index 4c969c8f4a5..555bfa674d0 100644 --- a/src/corelib/kernel/qobject.cpp +++ b/src/corelib/kernel/qobject.cpp @@ -807,19 +807,19 @@ QObject::~QObject() QObjectPrivate::clearGuards(this); } - if (d->sharedRefcount) { - if (d->sharedRefcount->strongref.load() > 0) { + QtSharedPointer::ExternalRefCountData *sharedRefcount = d->sharedRefcount.load(); + if (sharedRefcount) { + if (sharedRefcount->strongref.load() > 0) { qWarning("QObject: shared QObject was deleted directly. The program is malformed and may crash."); // but continue deleting, it's too late to stop anyway } // indicate to all QWeakPointers that this QObject has now been deleted - d->sharedRefcount->strongref.store(0); - if (!d->sharedRefcount->weakref.deref()) - delete d->sharedRefcount; + sharedRefcount->strongref.store(0); + if (!sharedRefcount->weakref.deref()) + delete sharedRefcount; } - if (d->isSignalConnected(0)) { QT_TRY { emit destroyed(this); |
