From c9cdb511049ebb0c529c1ac71f825b3217044161 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Sun, 6 Apr 2003 15:08:12 +0000 Subject: [PATCH] Fixes for wxLocale::Init and Borland C++ Backported from head git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@20017 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/changes.txt | 2 +- src/common/intl.cpp | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/docs/changes.txt b/docs/changes.txt index 4f936291cb..bea4984279 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -211,7 +211,7 @@ wxMSW: called before showing it - use ES_DISABLENOSCROLL to work around the vertical scrollbar bug in wxTE_RICH2 text control - +- fixes for wxLocale::Init and Borland C++ wxMotif: diff --git a/src/common/intl.cpp b/src/common/intl.cpp index c2c4bda648..c01fdca703 100644 --- a/src/common/intl.cpp +++ b/src/common/intl.cpp @@ -768,9 +768,13 @@ bool wxLocale::Init(int language, int flags) #endif #ifndef WX_NO_LOCALE_SUPPORT - return Init(name, canonical, retloc, - (flags & wxLOCALE_LOAD_DEFAULT) != 0, - (flags & wxLOCALE_CONV_ENCODING) != 0); + wxChar *szLocale = retloc ? wxStrdup(retloc) : NULL; + bool ret = Init(name, canonical, retloc, + (flags & wxLOCALE_LOAD_DEFAULT) != 0, + (flags & wxLOCALE_CONV_ENCODING) != 0); + if (szLocale) + free(szLocale); + return ret; #endif }