- LocaleSetter(const char *loc) : m_locOld(setlocale(LC_ALL, loc)) { }
- ~LocaleSetter() { setlocale(LC_ALL, m_locOld); }
+ LocaleSetter(const char *loc)
+ : m_locOld(wxStrdupA(setlocale(LC_ALL, NULL)))
+ {
+ setlocale(LC_ALL, loc);
+ }
+
+ ~LocaleSetter()
+ {
+ setlocale(LC_ALL, m_locOld);
+ free(m_locOld);
+ }