From 3202d00dc97f5c0a9b42397f5938e4fb4a345f65 Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Wed, 26 Nov 2003 19:33:35 +0000 Subject: [PATCH] assert if wxLocale::Init called twice git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@24668 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/intl.h | 2 ++ src/common/intl.cpp | 5 +++++ 2 files changed, 7 insertions(+) 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; -- 2.45.2