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>
This commit is contained in:
parent
a245945f29
commit
9a66dff369
@ -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())
|
||||
|
Loading…
x
Reference in New Issue
Block a user