summaryrefslogtreecommitdiffstats
path: root/src/corelib/text/qlocale_mac.mm
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2020-05-06 11:17:24 +0200
committerMarc Mutz <marc.mutz@kdab.com>2020-05-07 15:28:12 +0200
commit9a66dff369c94ff90364c106fd898b0136b451e5 (patch)
treec523d9ecef2c85185e56321cd1f444a1c385e7c1 /src/corelib/text/qlocale_mac.mm
parenta245945f29621ce9011f4c82f23076d2a28b5aa9 (diff)
QLocale/Mac: make envVarLocale() thread-safe
The old code used a static QByteArray, but would write to it on every invocation of the function. This makes the function non-re-entrant, even though it's callable from non-GUI-threads (via QSystemLocale::fallbackUiLocale()). Fix by using an automatic QByteArray instead. Change-Id: I93eea1dff1c72f3ea280283bb68b4ed47d2a8e1d Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/text/qlocale_mac.mm')
-rw-r--r--src/corelib/text/qlocale_mac.mm2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/text/qlocale_mac.mm b/src/corelib/text/qlocale_mac.mm
index 56a108c6e9..b1e067a8c2 100644
--- a/src/corelib/text/qlocale_mac.mm
+++ b/src/corelib/text/qlocale_mac.mm
@@ -56,7 +56,7 @@ QT_BEGIN_NAMESPACE
static QByteArray envVarLocale()
{
- static QByteArray lang;
+ QByteArray
#ifdef Q_OS_UNIX
lang = qgetenv("LC_ALL");
if (lang.isEmpty())