summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qlocale.cpp
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2017-02-09 21:50:30 +0100
committerEdward Welbourne <edward.welbourne@qt.io>2017-02-23 09:39:23 +0000
commit2c130701627ea5bc0df9af9c77edfa4d463b5dd1 (patch)
treee74c15e897b4a60a59fef8f041397f5361878863 /src/corelib/tools/qlocale.cpp
parentb56c8a3b3d93717c1229e77f6660140d890f936b (diff)
Do not delete someone else's QSystemLocale when constructing another
The QSystemLocale constructor remembers the most-recently-constructed instance - a dodgy enough proposition at the best of times - and shares it with much of the rest of QLocale. There is a global static instance, actually of a derived singleton class, to which it is usually set on program start-up. However, the constructor deleted the remembered instance before remembering any new instances; there was no way this could not lead to bad consequences. So let's not do that. Change-Id: Ie8f3d655c9d4f75f6ec00a5861d98d6020ecc633 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/tools/qlocale.cpp')
-rw-r--r--src/corelib/tools/qlocale.cpp1
1 files changed, 0 insertions, 1 deletions
diff --git a/src/corelib/tools/qlocale.cpp b/src/corelib/tools/qlocale.cpp
index 5b53b8b338..2ce410062a 100644
--- a/src/corelib/tools/qlocale.cpp
+++ b/src/corelib/tools/qlocale.cpp
@@ -594,7 +594,6 @@ static QLocalePrivate *c_private()
*/
QSystemLocale::QSystemLocale()
{
- delete _systemLocale;
_systemLocale = this;
if (system_data)