]> git.saurik.com Git - wxWidgets.git/commitdiff
(probably) fixed wxLocale::Init with Borland C++
authorVáclav Slavík <vslavik@fastmail.fm>
Fri, 17 Jan 2003 19:58:53 +0000 (19:58 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Fri, 17 Jan 2003 19:58:53 +0000 (19:58 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@18792 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/intl.cpp

index 5115e1d3cd2c313d2944b6ea35ee47a4bcc8171e..98bc6dcc078a6eb684184dd3ee991c1707538b81 100644 (file)
@@ -770,9 +770,13 @@ bool wxLocale::Init(int language, int flags)
     return FALSE;
 #endif
 
-    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;
 }