diff --git a/lib/TTLS_UI/src/Module.cpp b/lib/TTLS_UI/src/Module.cpp index f5ce579..c80b29a 100644 --- a/lib/TTLS_UI/src/Module.cpp +++ b/lib/TTLS_UI/src/Module.cpp @@ -43,7 +43,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 }; @@ -543,9 +543,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")); } } @@ -557,9 +558,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;