X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3bd1e033857b8dd6f4dea024d3f18fcc7682e09d..a4353f07c6b37712634d4b2d86527b647a08044f:/wxPython/src/msw/clip_dnd.cpp diff --git a/wxPython/src/msw/clip_dnd.cpp b/wxPython/src/msw/clip_dnd.cpp index e9a9f19cc1..321a322c0f 100644 --- a/wxPython/src/msw/clip_dnd.cpp +++ b/wxPython/src/msw/clip_dnd.cpp @@ -191,8 +191,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(); } @@ -293,10 +294,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; }