summaryrefslogtreecommitdiffstats
path: root/src/corelib/text/qlocale.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/text/qlocale.cpp')
-rw-r--r--src/corelib/text/qlocale.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/corelib/text/qlocale.cpp b/src/corelib/text/qlocale.cpp
index 46f3a5bb05..e31b5c9155 100644
--- a/src/corelib/text/qlocale.cpp
+++ b/src/corelib/text/qlocale.cpp
@@ -1225,8 +1225,16 @@ void QLocale::setDefault(const QLocale &locale)
{
default_data = locale.d->m_data;
- if (defaultLocalePrivate.exists()) // update the cached private
- *defaultLocalePrivate = locale.d;
+ if (defaultLocalePrivate.isDestroyed())
+ return; // avoid crash on exit
+ if (!defaultLocalePrivate.exists()) {
+ // Force it to exist; see QTBUG-83016
+ QLocale ignoreme;
+ Q_ASSERT(defaultLocalePrivate.exists());
+ }
+
+ // update the cached private
+ *defaultLocalePrivate = locale.d;
}
/*!