X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/525582584c8fe3a8ef11d2c981af415f7bab2073..dc259b792613550edda31cc6202b42e172e2a240:/src/common/intl.cpp diff --git a/src/common/intl.cpp b/src/common/intl.cpp index 5115e1d3cd..e2a7299f7a 100644 --- a/src/common/intl.cpp +++ b/src/common/intl.cpp @@ -768,11 +768,18 @@ bool wxLocale::Init(int language, int flags) wxMB2WXbuf retloc = wxSetlocale(LC_ALL , wxEmptyString); #else return FALSE; + #define WX_NO_LOCALE_SUPPORT #endif - return Init(name, canonical, retloc, - (flags & wxLOCALE_LOAD_DEFAULT) != 0, - (flags & wxLOCALE_CONV_ENCODING) != 0); +#ifndef WX_NO_LOCALE_SUPPORT + 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 }