QSystemLocale: bail out if accessed post-destruction
There's little we can do, but a lot of content ends up in QLocale very late in the execution. Let's at least not crash. Task-number: QTBUG-133206 Change-Id: I77d41141cb115147f9befffdd5e69dac19c96044 Reviewed-by: Albert Astals Cid <aacid@kde.org> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> (cherry picked from commit e32f28034ad2383393645777bcd96eab3f696076) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit d5c5f9f3529b384d0d4bea2d51f0ad6a3d57481d)bb10
parent
686d994a44
commit
2ef615228b
|
|
@ -127,6 +127,8 @@ QLocale QSystemLocale::fallbackLocale() const
|
|||
QVariant QSystemLocale::query(QueryType type, QVariant &&in) const
|
||||
{
|
||||
QSystemLocaleData *d = qSystemLocaleData();
|
||||
if (!d)
|
||||
return QVariant();
|
||||
|
||||
if (type == LocaleChanged) {
|
||||
d->readEnvironment();
|
||||
|
|
|
|||
|
|
@ -828,6 +828,8 @@ QLocale QSystemLocale::fallbackLocale() const
|
|||
QVariant QSystemLocale::query(QueryType type, QVariant &&in) const
|
||||
{
|
||||
QSystemLocalePrivate *d = systemLocalePrivate();
|
||||
if (!d)
|
||||
return QVariant();
|
||||
switch(type) {
|
||||
case DecimalPoint:
|
||||
return d->decimalPoint();
|
||||
|
|
|
|||
Loading…
Reference in New Issue