* 0001-Revert-QThread-Unix-move-the-pthread_key-to-a-file-s.patch * 0002-Revert-QThread-Unix-revert-to-pthread-destruction-in.patch - Add patches (kde#499537, QTBUG-133500, QTBUG-130278) * 0001-QLocale-try-to-survive-being-created-during-applicat.patch * 0001-QSystemLocale-bail-out-if-accessed-post-destruction.patch * 0001-QLibraryInfo-speed-up-checking-if-qt-etc-qt.conf-res.patch OBS-URL: https://build.opensuse.org/package/show/KDE:Qt6/qt6-base?expand=0&rev=130
50 lines
1.6 KiB
Diff
50 lines
1.6 KiB
Diff
From 12d4bf1ab52748cb84894f50d437064b439e0b7d Mon Sep 17 00:00:00 2001
|
|
From: Thiago Macieira <thiago.macieira@intel.com>
|
|
Date: Fri, 24 Jan 2025 10:43:38 -0800
|
|
Subject: [PATCH] QLocale: try to survive being created during application shut
|
|
down
|
|
|
|
QLocale is very often accessed during global static destructors, so
|
|
let's try and survive if the default has already been destroyed. In that
|
|
case, we shall fall back to the C locale.
|
|
|
|
I've placed the call to systemData(), which updates the system locale,
|
|
before the initialization of defaultLocalePrivate, as the initialization
|
|
of the latter depends on the former.
|
|
|
|
Task-number: QTBUG-133206
|
|
Change-Id: I48e29b45f9be4514336cfffdf5affa5631a956a3
|
|
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
|
|
Reviewed-by: Albert Astals Cid <aacid@kde.org>
|
|
(cherry picked from commit e0a1f491567f2495443babc5aa36a038260f96c6)
|
|
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
|
|
(cherry picked from commit bcc0e6124a2ec80df535178d056324433f9ff984)
|
|
---
|
|
src/corelib/text/qlocale.cpp | 9 ++++++---
|
|
1 file changed, 6 insertions(+), 3 deletions(-)
|
|
|
|
diff --git a/src/corelib/text/qlocale.cpp b/src/corelib/text/qlocale.cpp
|
|
index 4f5b5452648..eff083b3d94 100644
|
|
--- a/src/corelib/text/qlocale.cpp
|
|
+++ b/src/corelib/text/qlocale.cpp
|
|
@@ -1112,10 +1112,13 @@ QLocale::QLocale(QStringView name)
|
|
*/
|
|
|
|
QLocale::QLocale()
|
|
- : d(*defaultLocalePrivate)
|
|
+ : d(c_private())
|
|
{
|
|
- // Make sure system data is up to date:
|
|
- systemData();
|
|
+ if (!defaultLocalePrivate.isDestroyed()) {
|
|
+ // Make sure system data is up to date:
|
|
+ systemData();
|
|
+ d = *defaultLocalePrivate;
|
|
+ }
|
|
}
|
|
|
|
/*!
|
|
--
|
|
2.48.1
|
|
|