From 9a66dff369c94ff90364c106fd898b0136b451e5 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Wed, 6 May 2020 11:17:24 +0200 Subject: [PATCH] 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 Reviewed-by: Thiago Macieira --- src/corelib/text/qlocale_mac.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/text/qlocale_mac.mm b/src/corelib/text/qlocale_mac.mm index 56a108c6e96..b1e067a8c21 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())