assert if wxLocale::Init called twice

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@24668 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík
2003-11-26 19:33:35 +00:00
parent eea650d869
commit 3202d00dc9
2 changed files with 7 additions and 0 deletions

View File

@@ -520,6 +520,8 @@ private:
bool m_bConvertEncoding;
bool m_initialized;
static wxLanguageInfoArray *ms_languagesDB;
DECLARE_NO_COPY_CLASS(wxLocale)

View File

@@ -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;