Locale is dynamic now, since wxLocale does not support re-initialization (when module is reused)

This commit is contained in:
Simon Rozman 2017-02-22 09:42:18 +01:00
parent 6df6eeaa0a
commit 0abae8fe0e

View File

@ -37,7 +37,7 @@ public:
protected:
static wxCriticalSection s_lock; ///< Initialization lock
static unsigned long s_init_ref_count; ///< Initialization reference counter
static wxLocale s_locale; ///< Locale
static wxLocale *s_locale; ///< Locale
};
@ -343,9 +343,10 @@ wxInitializerPeer::wxInitializerPeer(_In_ HINSTANCE instance)
// Do our wxWidgets configuration and localization initialization.
wxInitializeConfig();
if (wxInitializeLocale(s_locale)) {
s_locale.AddCatalog(wxT("wxExtend") wxT(wxExtendVersion));
s_locale.AddCatalog(wxT("EAPTTLSUI"));
s_locale = new wxLocale;
if (wxInitializeLocale(*s_locale)) {
s_locale->AddCatalog(wxT("wxExtend") wxT(wxExtendVersion));
s_locale->AddCatalog(wxT("EAPTTLSUI"));
}
}
@ -357,9 +358,14 @@ wxInitializerPeer::~wxInitializerPeer()
return;
wxEntryCleanup();
if (s_locale) {
delete s_locale;
s_locale = NULL;
}
}
wxCriticalSection wxInitializerPeer::s_lock;
unsigned long wxInitializerPeer::s_init_ref_count = 0;
wxLocale wxInitializerPeer::s_locale;
wxLocale *wxInitializerPeer::s_locale = NULL;