summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@nokia.com>2009-08-12 09:03:49 (GMT)
committerThiago Macieira <thiago.macieira@nokia.com>2009-08-12 09:12:36 (GMT)
commit171d92dc8b800b24d28c7b4abf34d6961763bbf4 (patch)
treebcf2ce2ebf6546faa5cc2dc69e01687adb82f947 /src
parentc8563ec79f01ec54a03bb2fdbba11a73a01370f7 (diff)
downloadQt-171d92dc8b800b24d28c7b4abf34d6961763bbf4.zip
Qt-171d92dc8b800b24d28c7b4abf34d6961763bbf4.tar.gz
Qt-171d92dc8b800b24d28c7b4abf34d6961763bbf4.tar.bz2
Autotest: make sure we can't create QWeakPointer from a QObject in destruction.
This test only works in debug mode
Diffstat (limited to 'src')
-rw-r--r--src/corelib/tools/qsharedpointer.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/corelib/tools/qsharedpointer.cpp b/src/corelib/tools/qsharedpointer.cpp
index f793f26..e3e1db6 100644
--- a/src/corelib/tools/qsharedpointer.cpp
+++ b/src/corelib/tools/qsharedpointer.cpp
@@ -977,6 +977,8 @@ QtSharedPointer::ExternalRefCountData *QtSharedPointer::ExternalRefCountData::ge
{
Q_ASSERT(obj);
QObjectPrivate *d = QObjectPrivate::get(const_cast<QObject *>(obj));
+ Q_ASSERT_X(!d->wasDeleted, "QWeakPointer", "Detected QWeakPointer creation in a QObject being deleted");
+
ExternalRefCountData *that = d->sharedRefcount;
if (that) {
that->weakref.ref();