summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@nokia.com>2011-09-28 11:55:00 (GMT)
committerOswald Buddenhagen <oswald.buddenhagen@nokia.com>2011-09-28 11:55:00 (GMT)
commitd81ddfd44455c79d0a44ab1caf29939b287dd895 (patch)
tree9b4383c5c23b405170ff9b2b5edb6762165828bb /src/corelib/kernel
parent89ae1ec634f82f89e97f3e19b5d5fb0da9b3092f (diff)
parentc75aabbb022e3c2db246e2fd90a36662cf28ec24 (diff)
downloadQt-d81ddfd44455c79d0a44ab1caf29939b287dd895.zip
Qt-d81ddfd44455c79d0a44ab1caf29939b287dd895.tar.gz
Qt-d81ddfd44455c79d0a44ab1caf29939b287dd895.tar.bz2
Merge remote-tracking branch 'mainline/4.8'
Diffstat (limited to 'src/corelib/kernel')
-rw-r--r--src/corelib/kernel/qcoreapplication.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp
index 18a5eae..752bbaa 100644
--- a/src/corelib/kernel/qcoreapplication.cpp
+++ b/src/corelib/kernel/qcoreapplication.cpp
@@ -273,6 +273,29 @@ bool QCoreApplicationPrivate::is_app_closing = false;
// initialized in qcoreapplication and in qtextstream autotest when setlocale is called.
Q_CORE_EXPORT bool qt_locale_initialized = false;
+#ifdef Q_OS_SYMBIAN
+// The global QSettings needs to be cleaned where cleanup stack is available, which is not
+// normally the case when global static destructors are run.
+// Declare a custom QGlobalStaticDeleter for QSettings to handle that case.
+template<>
+class QGlobalStaticDeleter<QSettings>
+{
+public:
+ QGlobalStatic<QSettings> &globalStatic;
+ QGlobalStaticDeleter(QGlobalStatic<QSettings> &_globalStatic)
+ : globalStatic(_globalStatic)
+ { }
+
+ inline ~QGlobalStaticDeleter()
+ {
+ CTrapCleanup *cleanup = CTrapCleanup::New();
+ delete globalStatic.pointer;
+ delete cleanup;
+ globalStatic.pointer = 0;
+ globalStatic.destroyed = true;
+ }
+};
+#endif
/*
Create an instance of Trolltech.conf. This ensures that the settings will not