summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/kernel/qobject/tst_qobject.cpp
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2012-02-24 18:44:17 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-01-22 17:15:58 +0100
commitf7eff7251786186ca895c8fc537b304bc89977b3 (patch)
tree161dd1a09188b8d3b61a5fd2dafbf43764d8424e /tests/auto/corelib/kernel/qobject/tst_qobject.cpp
parent326a5e0bca9e77ce9d6a93e301c6b52a56278453 (diff)
Add a new Q_GLOBAL_STATIC implementation
Unlike the previous implementation, this implementation is locked: only one initialisation is ever run at the same time. It is exception-safe, meaning that a throwing constructor will restart the process. Also, start using the thread-safe behaviour that GCC has offered for a long time and C++11 requires. Change-Id: I20db44f57d258923df64c0051358fd0d9a5ccd51 Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: David Faure (KDE) <faure@kde.org> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
Diffstat (limited to 'tests/auto/corelib/kernel/qobject/tst_qobject.cpp')
-rw-r--r--tests/auto/corelib/kernel/qobject/tst_qobject.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/auto/corelib/kernel/qobject/tst_qobject.cpp b/tests/auto/corelib/kernel/qobject/tst_qobject.cpp
index 581644b19f..d7add383e1 100644
--- a/tests/auto/corelib/kernel/qobject/tst_qobject.cpp
+++ b/tests/auto/corelib/kernel/qobject/tst_qobject.cpp
@@ -144,6 +144,16 @@ private slots:
void disconnectDoesNotLeakFunctor();
};
+struct QObjectCreatedOnShutdown
+{
+ QObjectCreatedOnShutdown() {}
+ ~QObjectCreatedOnShutdown()
+ {
+ QObject();
+ }
+};
+static QObjectCreatedOnShutdown s_qobjectCreatedOnShutdown;
+
class SenderObject : public QObject
{
Q_OBJECT