From 05d336620cf87fbffc07f2df15e1ba5aeea7ef71 Mon Sep 17 00:00:00 2001 From: Ivan Solovev Date: Mon, 6 Sep 2021 14:14:35 +0200 Subject: [PATCH] Fix system locale instantiation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Construction of the static QLocalePrivate called defaultIndex() and systemData() in an implementation-dependent order, but defaultIndex() needs to be called after systemData(). So move the systemData() call that's used to ensure it all stays up to date to before the static initializer. Pick-to: 6.2 Change-Id: I801b678c01b4e4ddd4de16e9aead7167ec4477f3 Reviewed-by: Thiago Macieira Reviewed-by: Edward Welbourne Reviewed-by: MÃ¥rten Nordheim --- src/corelib/text/qlocale.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/text/qlocale.cpp b/src/corelib/text/qlocale.cpp index 2a4b65a81f..8ff896b0c5 100644 --- a/src/corelib/text/qlocale.cpp +++ b/src/corelib/text/qlocale.cpp @@ -2650,8 +2650,8 @@ QString QLocale::toString(double f, char format, int precision) const QLocale QLocale::system() { + QT_PREPEND_NAMESPACE(systemData)(); // Ensure system data is up to date. static QLocalePrivate locale(systemData(), defaultIndex(), DefaultNumberOptions, 1); - QT_PREPEND_NAMESPACE(systemData)(); // trigger updating of the system data if necessary return QLocale(locale); }