summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp
diff options
context:
space:
mode:
authorSergio Ahumada <sergio.ahumada@digia.com>2013-03-20 23:30:31 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-03-20 23:30:31 +0100
commite5a11fbb3251a98fafd6bebf0b6fc366acb19088 (patch)
tree8e1bd6704205307e0a23484221ea1bb67a9f411e /tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp
parent0646d1131b4bc65cdd9af29f4ce00fdd2398a3df (diff)
parent76c0be34cd4ff4564693162fa7528463e23ce9d8 (diff)
Merge "Merge branch 'dev' into stable" into refs/staging/stable
Diffstat (limited to 'tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp')
-rw-r--r--tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp b/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp
index 42bf9eeca3..10c00e2a67 100644
--- a/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp
+++ b/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp
@@ -769,6 +769,18 @@ void tst_QCoreApplication::testQuitLock()
app.exec();
}
+static void createQObjectOnDestruction()
+{
+ // Make sure that we can create a QObject after the last QObject has been
+ // destroyed (especially after QCoreApplication has).
+ //
+ // Before the fixes, this would cause a dangling pointer dereference. If
+ // the problem comes back, it's possible that the following causes no
+ // effect.
+ QObject obj;
+ obj.thread()->setProperty("testing", 1);
+}
+Q_DESTRUCTOR_FUNCTION(createQObjectOnDestruction)
QTEST_APPLESS_MAIN(tst_QCoreApplication)
#include "tst_qcoreapplication.moc"