From: Vadim Zeitlin <vadim@wxwidgets.org> Date: Sun, 2 Jan 2005 23:44:36 +0000 (+0000) Subject: fixed crash when setting locale failed (replaces patch 1093811) X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/bea561cec04633a5810f3166107bd2d0288d4091 fixed crash when setting locale failed (replaces patch 1093811) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31215 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/common/intl.cpp b/src/common/intl.cpp index 2609e2c55a..f0512af3cc 100644 --- a/src/common/intl.cpp +++ b/src/common/intl.cpp @@ -1402,6 +1402,7 @@ wxLanguageInfoArray *wxLocale::ms_languagesDB = NULL; void wxLocale::DoCommonInit() { m_pszOldLocale = NULL; + m_pOldLocale = NULL; m_pMsgCat = NULL; m_language = wxLANGUAGE_UNKNOWN; m_initialized = false; @@ -2448,8 +2449,10 @@ wxLocale::~wxLocale() delete pTmpCat; } - // restore old locale - wxSetLocale(m_pOldLocale); + // restore old locale if we had changed it + if ( m_pOldLocale ) + wxSetLocale(m_pOldLocale); + // FIXME #ifndef __WXWINCE__ wxSetlocale(LC_ALL, m_pszOldLocale);