]> git.saurik.com Git - wxWidgets.git/blobdiff - tests/testprec.h
fix vertical mouse wheel event rotation value, sign was reversed in r74805
[wxWidgets.git] / tests / testprec.h
index 0005f5bb3ea42d75eac92fa78e615e0216cc4980..3e8ed28a63414bcc8c82dba84590b4b0cfe52395 100644 (file)
@@ -132,11 +132,20 @@ extern bool IsAutomaticTest();
 class LocaleSetter
 {
 public:
-    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);
+    }
 
 private:
-    const char * const m_locOld;
+    char * const m_locOld;
 
     wxDECLARE_NO_COPY_CLASS(LocaleSetter);
 };