]> git.saurik.com Git - wxWidgets.git/commitdiff
fix to the last fix (see comments in patch 1093811)
authorVadim Zeitlin <vadim@wxwidgets.org>
Mon, 3 Jan 2005 13:51:06 +0000 (13:51 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Mon, 3 Jan 2005 13:51:06 +0000 (13:51 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31220 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/intl.cpp

index f0512af3cc59702465f61366e383d402175f4fc9..d1196aa6fbb6ca15477c2360d99720b2314f6c1a 100644 (file)
@@ -1402,7 +1402,9 @@ wxLanguageInfoArray *wxLocale::ms_languagesDB = NULL;
 void wxLocale::DoCommonInit()
 {
   m_pszOldLocale = NULL;
 void wxLocale::DoCommonInit()
 {
   m_pszOldLocale = NULL;
-  m_pOldLocale = NULL;
+
+  m_pOldLocale = wxSetLocale(this);
+
   m_pMsgCat = NULL;
   m_language = wxLANGUAGE_UNKNOWN;
   m_initialized = false;
   m_pMsgCat = NULL;
   m_language = wxLANGUAGE_UNKNOWN;
   m_initialized = false;
@@ -1471,9 +1473,6 @@ bool wxLocale::Init(const wxChar *szName,
     }
   }
 
     }
   }
 
-  // save the old locale to be able to restore it later
-  m_pOldLocale = wxSetLocale(this);
-
   // load the default catalog with wxWidgets standard messages
   m_pMsgCat = NULL;
   bool bOk = true;
   // load the default catalog with wxWidgets standard messages
   m_pMsgCat = NULL;
   bool bOk = true;
@@ -2449,9 +2448,8 @@ wxLocale::~wxLocale()
         delete pTmpCat;
     }
 
         delete pTmpCat;
     }
 
-    // restore old locale if we had changed it
-    if ( m_pOldLocale )
-        wxSetLocale(m_pOldLocale);
+    // restore old locale pointer
+    wxSetLocale(m_pOldLocale);
 
     // FIXME
 #ifndef __WXWINCE__
 
     // FIXME
 #ifndef __WXWINCE__