summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiikka Heikkinen <miikka.heikkinen@qt.io>2019-05-22 15:27:11 +0300
committerJari Karppinen <jari.karppinen@qt.io>2019-05-23 07:36:04 +0300
commit5f7a8fba3b56ec0fc44e2cd3ba4fc91195054fed (patch)
tree194956f3b2e23ec2bffd111d4501e433a423eaed
parent8fcc9f2bd7929a945f4146d721bb8525c2cb8b98 (diff)
Fix intermittent crash when accessing static C-locale object
Using static QLocale instance sometimes crashes on application startup. It is unclear why this happens, but since QLocale already provides a static function to access a static C-locale instance, there is no need to store our own copy of it. Change-Id: I39f17623eab657268e69d80e0fcc9005f0401656 Reviewed-by: Antti Määttä <antti.maatta@qt.io> Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io> Reviewed-by: Jari Karppinen <jari.karppinen@qt.io>
-rw-r--r--src/Authoring/QT3DSDM/Systems/Qt3DSDMWStrOpsImpl.h6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/Authoring/QT3DSDM/Systems/Qt3DSDMWStrOpsImpl.h b/src/Authoring/QT3DSDM/Systems/Qt3DSDMWStrOpsImpl.h
index eec2cf3b..a594abed 100644
--- a/src/Authoring/QT3DSDM/Systems/Qt3DSDMWStrOpsImpl.h
+++ b/src/Authoring/QT3DSDM/Systems/Qt3DSDMWStrOpsImpl.h
@@ -187,9 +187,8 @@ struct WStrOps<QT3DSF32>
}
bool StrTo(const char8_t *buffer, QT3DSF32 &item)
{
- static QLocale c(QLocale::C);
bool ok;
- item = c.toFloat(buffer, &ok);
+ item = QLocale::c().toFloat(buffer, &ok);
return ok;
}
};
@@ -203,9 +202,8 @@ struct WStrOps<QT3DSF64>
}
bool StrTo(const char8_t *buffer, QT3DSF64 &item)
{
- static QLocale c(QLocale::C);
bool ok;
- item = c.toDouble(buffer, &ok);
+ item = QLocale::c().toDouble(buffer, &ok);
return ok;
}
};