From 0a0a28730bb192fad1a1eb11896dd1fdb2ef0b45 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Fri, 2 Sep 2016 10:00:19 +0200 Subject: [PATCH] wxWidget initialization improved to share same locale --- lib/TTLS_UI/src/Module.cpp | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/lib/TTLS_UI/src/Module.cpp b/lib/TTLS_UI/src/Module.cpp index 4d14d58..6ad3619 100644 --- a/lib/TTLS_UI/src/Module.cpp +++ b/lib/TTLS_UI/src/Module.cpp @@ -23,9 +23,6 @@ using namespace std; using namespace winstd; -static wxCriticalSection s_lock; -static unsigned long s_init_ref_count = 0; - ////////////////////////////////////////////////////////////////////// // wxInitializerPeer @@ -38,7 +35,9 @@ public: virtual ~wxInitializerPeer(); protected: - wxLocale m_locale; ///< Locale + static wxCriticalSection s_lock; ///< Initialization lock + static unsigned long s_init_ref_count; ///< Initialization reference counter + static wxLocale s_locale; ///< Locale }; @@ -341,9 +340,9 @@ wxInitializerPeer::wxInitializerPeer(_In_ HINSTANCE instance) // Do our wxWidgets configuration and localization initialization. wxInitializeConfig(); - if (wxInitializeLocale(m_locale)) { - //m_locale.AddCatalog(wxT("wxExtend") wxT(wxExtendVersion)); - m_locale.AddCatalog(wxT("EAPTTLSUI")); + if (wxInitializeLocale(s_locale)) { + //s_locale.AddCatalog(wxT("wxExtend") wxT(wxExtendVersion)); + s_locale.AddCatalog(wxT("EAPTTLSUI")); } } @@ -356,3 +355,8 @@ wxInitializerPeer::~wxInitializerPeer() wxEntryCleanup(); } + + +wxCriticalSection wxInitializerPeer::s_lock; +unsigned long wxInitializerPeer::s_init_ref_count = 0; +wxLocale wxInitializerPeer::s_locale;