From 2c130701627ea5bc0df9af9c77edfa4d463b5dd1 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Thu, 9 Feb 2017 21:50:30 +0100 Subject: [PATCH] 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 --- src/corelib/tools/qlocale.cpp | 1 - 1 file changed, 1 deletion(-) 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)