]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/src/windows.i
Fixed compilation error
[wxWidgets.git] / wxPython / src / windows.i
index c12a3168114990904b766dea141b3e452fc5b555..c75d8aeaab049b1a5017b659f260b185d48fa167 100644 (file)
@@ -104,11 +104,11 @@ public:
     ~wxPyValidator() {
     }
 
-    wxObject* wxPyValidator::Clone() const {
+    wxObject* Clone() const {
         wxPyValidator* ptr = NULL;
         wxPyValidator* self = (wxPyValidator*)this;
 
-        bool doSave = wxPyRestoreThread();
+        wxPyTState* state = wxPyBeginBlockThreads();
         if (self->m_myInst.findCallback("Clone")) {
             PyObject* ro;
             ro = self->m_myInst.callCallbackObj(Py_BuildValue("()"));
@@ -117,13 +117,13 @@ public:
                 Py_DECREF(ro);
             }
         }
+        wxPyEndBlockThreads(state);
+
         // This is very dangerous!!! But is the only way I could find
         // to squash a memory leak.  Currently it is okay, but if the
         // validator architecture in wxWindows ever changes, problems
         // could arise.
         delete self;
-
-        wxPySaveThread(doSave);
         return ptr;
     }