]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/src/controls2.i
Fix for the TAB in the autocomplete list not being used correctly
[wxWidgets.git] / wxPython / src / controls2.i
index aa63f8a257b7a6e7f6bbd0aee3a8b632c3dc06d6..31acadfa5ecacde7cb1b8a04cace9910908ff055 100644 (file)
@@ -1075,11 +1075,13 @@ public:
         int rval = 0;
         bool found;
         wxPyBeginBlockThreads();
-        if ((found = m_myInst.findCallback("OnCompareItems")))
-            rval = m_myInst.callCallback(Py_BuildValue(
-                "(OO)",
-                wxPyConstructObject((void*)&item1, "wxTreeItemId"),
-                wxPyConstructObject((void*)&item2, "wxTreeItemId")));
+        if ((found = m_myInst.findCallback("OnCompareItems"))) {
+            PyObject *o1 = wxPyConstructObject((void*)&item1, "wxTreeItemId");
+            PyObject *o2 = wxPyConstructObject((void*)&item2, "wxTreeItemId");
+            rval = m_myInst.callCallback(Py_BuildValue("(OO)",o1,o2));
+            Py_DECREF(o1);
+            Py_DECREF(o2);
+        }
         wxPyEndBlockThreads();
         if (! found)
             rval = wxTreeCtrl::OnCompareItems(item1, item2);