diff --git a/include/wx/intl.h b/include/wx/intl.h index 5347ebf0de..c784562899 100644 --- a/include/wx/intl.h +++ b/include/wx/intl.h @@ -520,6 +520,8 @@ private: bool m_bConvertEncoding; + bool m_initialized; + static wxLanguageInfoArray *ms_languagesDB; DECLARE_NO_COPY_CLASS(wxLocale) diff --git a/src/common/intl.cpp b/src/common/intl.cpp index 0bbad0de46..753dfcb11e 100644 --- a/src/common/intl.cpp +++ b/src/common/intl.cpp @@ -1369,6 +1369,7 @@ wxLocale::wxLocale() m_pszOldLocale = NULL; m_pMsgCat = NULL; m_language = wxLANGUAGE_UNKNOWN; + m_initialized = false; } // NB: this function has (desired) side effect of changing current locale @@ -1378,6 +1379,10 @@ bool wxLocale::Init(const wxChar *szName, bool bLoadDefault, bool bConvertEncoding) { + wxASSERT_MSG( !m_initialized, + _T("you can't call wxLocale::Init more than once") ); + + m_initialized = true; m_strLocale = szName; m_strShort = szShort; m_bConvertEncoding = bConvertEncoding;