]> git.saurik.com Git - wxWidgets.git/blobdiff - src/xrc/xmlres.cpp
restore caching of WM frame extents
[wxWidgets.git] / src / xrc / xmlres.cpp
index 466faa9870f12e8290595f976ec1111bad030441..c69e3bb24ba2d4fc00a671d3a3202e9c87d42a1c 100644 (file)
@@ -995,6 +995,7 @@ float wxXmlResourceHandler::GetFloat(const wxString& param, float defaultv)
 {
     wxString str = GetParamValue(param);
 
+#if wxUSE_LOCALE
     // strings in XRC always use C locale but wxString::ToDouble() uses the
     // current one, so transform the string to it supposing that the only
     // difference between them is the decimal separator
@@ -1002,6 +1003,7 @@ float wxXmlResourceHandler::GetFloat(const wxString& param, float defaultv)
     // TODO: use wxString::ToCDouble() when we have it
     str.Replace(wxT("."), wxLocale::GetInfo(wxLOCALE_DECIMAL_POINT,
                                             wxLOCALE_CAT_NUMBER));
+#endif // wxUSE_LOCALE
 
     double value;
     if (!str.ToDouble(&value))
@@ -1782,6 +1784,17 @@ static void AddStdXRCID_Records()
 
 // --------------- module and globals -----------------------------
 
+// normally we would do the cleanup from wxXmlResourceModule::OnExit() but it
+// can happen that some XRC records have been created because of the use of
+// XRCID() in event tables, which happens during static objects initialization,
+// but then the application initialization failed and so the wx modules were
+// neither initialized nor cleaned up -- this static object does the cleanup in
+// this case
+static struct wxXRCStaticCleanup
+{
+    ~wxXRCStaticCleanup() { CleanXRCID_Records(); }
+} s_staticCleanup;
+
 class wxXmlResourceModule: public wxModule
 {
 DECLARE_DYNAMIC_CLASS(wxXmlResourceModule)