]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/src/msw/clip_dnd.cpp
Font updates
[wxWidgets.git] / wxPython / src / msw / clip_dnd.cpp
index e9a9f19cc1125e96008142d48285e83cbc0eae4a..321a322c0fffef3b3bed6f96e52b92a3c57fbfbb 100644 (file)
@@ -191,8 +191,9 @@ wxBitmap wxPyBitmapDataObject::GetBitmap() {
 void wxPyBitmapDataObject::SetBitmap(const wxBitmap& bitmap) {
     wxPyBeginBlockThreads();
     if (m_myInst.findCallback("SetBitmap")) {
 void wxPyBitmapDataObject::SetBitmap(const wxBitmap& bitmap) {
     wxPyBeginBlockThreads();
     if (m_myInst.findCallback("SetBitmap")) {
-        m_myInst.callCallback(Py_BuildValue("(O)",
-                              wxPyConstructObject((void*)&bitmap, "wxBitmap")));
+        PyObject* bo = wxPyConstructObject((void*)&bitmap, "wxBitmap");
+        m_myInst.callCallback(Py_BuildValue("(O)", bo));
+        Py_DECREF(bo);
     }
     wxPyEndBlockThreads();
 }
     }
     wxPyEndBlockThreads();
 }
@@ -293,10 +294,11 @@ bool wxPyFileDropTarget::OnDropFiles(wxCoord x, wxCoord y,
                                      const wxArrayString& filenames) {
     bool rval = FALSE;
     wxPyBeginBlockThreads();
                                      const wxArrayString& filenames) {
     bool rval = FALSE;
     wxPyBeginBlockThreads();
-    PyObject* list = wxArrayString2PyList_helper(filenames);
-    if (m_myInst.findCallback("OnDropFiles"))
+    if (m_myInst.findCallback("OnDropFiles")) {
+        PyObject* list = wxArrayString2PyList_helper(filenames);
         rval = m_myInst.callCallback(Py_BuildValue("(iiO)",x,y,list));
         rval = m_myInst.callCallback(Py_BuildValue("(iiO)",x,y,list));
-    Py_DECREF(list);
+        Py_DECREF(list);
+    }
     wxPyEndBlockThreads();
     return rval;
 }
     wxPyEndBlockThreads();
     return rval;
 }