]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/src/events.i
correction for memory leak
[wxWidgets.git] / wxPython / src / events.i
index 029e29bdd6d4c02866f4f8bcf003a7ebfff5c16c..e6933f8e25bd8e8a07e550378f536dc707d8335c 100644 (file)
@@ -89,6 +89,18 @@ public:
     void SetExtraLong(long extraLong);
     void SetInt(int i);
 
+    %addmethods {
+        PyObject* GetClientData() {
+            wxPyClientData* data = (wxPyClientData*)self->GetClientObject();
+            if (data) {
+                Py_INCREF(data->m_obj);
+                return data->m_obj;
+            } else {
+                Py_INCREF(Py_None);
+                return Py_None;
+            }
+        }
+    }
 };