]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/src/clip_dnd.i
Allow compiling when _WIN32_IE < 0x300
[wxWidgets.git] / wxPython / src / clip_dnd.i
index a1d9058763bb7e808a6921cc14d3fb2c15e780ed..d1be82ee3e954c85288c7b63181395247e6c6090 100644 (file)
@@ -13,8 +13,6 @@
 
 %module clip_dnd
 
-#ifndef __WXMAC__
-
 %{
 #include "helpers.h"
 #include <wx/dataobj.h>
@@ -290,8 +288,9 @@ wxBitmap wxPyBitmapDataObject::GetBitmap() {
 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();
 }
@@ -627,10 +626,11 @@ bool wxPyFileDropTarget::OnDropFiles(wxCoord x, wxCoord y,
                                      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));
-    Py_DECREF(list);
+        Py_DECREF(list);
+    }
     wxPyEndBlockThreads();
     return rval;
 }
@@ -674,5 +674,5 @@ public:
 %}
 
 //----------------------------------------------------------------------
-#endif
+