aboutsummaryrefslogtreecommitdiff
path: root/src/corelib/i18n
diff options
context:
space:
mode:
authorJohn Tapsell <john.tapsell.ext@basyskom.de>2010-08-17 02:19:56 +0900
committerTomas Junnonen <tomas.junnonen@nokia.com>2010-08-17 13:05:14 +0300
commit91aaf4b1c653ec4f66b609eb5b189883120b7336 (patch)
treedfd5638260a0b8588c02ef25c408697b9c321baa /src/corelib/i18n
parent26dcac95bf6c65ee770e06f1f2fb622ae192e7ab (diff)
Fixes: NB#180677 - Delete MLocale etc when MApplication is deleted
RevBy: Ville Voutilainen
Diffstat (limited to 'src/corelib/i18n')
-rw-r--r--src/corelib/i18n/mlocale.cpp5
-rw-r--r--src/corelib/i18n/mlocale.h2
2 files changed, 7 insertions, 0 deletions
diff --git a/src/corelib/i18n/mlocale.cpp b/src/corelib/i18n/mlocale.cpp
index 917b7064..5d687bf0 100644
--- a/src/corelib/i18n/mlocale.cpp
+++ b/src/corelib/i18n/mlocale.cpp
@@ -1117,6 +1117,11 @@ static QMutex defaultLocaleMutex;
// The static default locale
MLocale *MLocale::s_systemDefault = 0;
+struct MStaticLocaleDestroyer {
+ ~MStaticLocaleDestroyer() { delete MLocale::s_systemDefault; MLocale::s_systemDefault = 0; }
+};
+static MStaticLocaleDestroyer staticLocaleDestroyer;
+
void MLocale::setDefault(const MLocale &locale)
{
defaultLocaleMutex.lock();
diff --git a/src/corelib/i18n/mlocale.h b/src/corelib/i18n/mlocale.h
index 48439607..f048ef16 100644
--- a/src/corelib/i18n/mlocale.h
+++ b/src/corelib/i18n/mlocale.h
@@ -35,6 +35,7 @@ class MCalendar;
class MBreakIteratorPrivate;
class MLocalePrivate;
+class MStaticLocaleDestroyer;
/*!
* \class MLocale
@@ -1332,6 +1333,7 @@ private:
friend class MCalendar;
friend class MCollator;
+ friend class MStaticLocaleDestroyer;
friend class MIcuBreakIteratorPrivate;
private Q_SLOTS: