X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/493f1553fdfd276ed9944c5f1c070ee34be13b52..16d38102e8ad5534d185cc532b9aa8077a75e0a4:/wxPython/src/msw/clip_dnd.cpp diff --git a/wxPython/src/msw/clip_dnd.cpp b/wxPython/src/msw/clip_dnd.cpp index aa329a0733..3b38150b0d 100644 --- a/wxPython/src/msw/clip_dnd.cpp +++ b/wxPython/src/msw/clip_dnd.cpp @@ -119,7 +119,7 @@ bool wxPyDataObjectSimple::GetDataHere(void *buf) { // C++ version. bool rval = FALSE; - bool doSave = wxPyRestoreThread(); + wxPyTState* state = wxPyBeginBlockThreads(); if (m_myInst.findCallback("GetDataHere")) { PyObject* ro; ro = m_myInst.callCallbackObj(Py_BuildValue("()")); @@ -130,7 +130,7 @@ bool wxPyDataObjectSimple::GetDataHere(void *buf) { Py_DECREF(ro); } } - wxPySaveThread(doSave); + wxPyEndBlockThreads(state); return rval; } @@ -138,13 +138,13 @@ bool wxPyDataObjectSimple::SetData(size_t len, const void *buf) { // For this one we simply need to make a string from buf and len // and send it to the Python method. bool rval = FALSE; - bool doSave = wxPyRestoreThread(); + wxPyTState* state = wxPyBeginBlockThreads(); if (m_myInst.findCallback("SetData")) { PyObject* data = PyString_FromStringAndSize((char*)buf, len); rval = m_myInst.callCallback(Py_BuildValue("(O)", data)); Py_DECREF(data); } - wxPySaveThread(doSave); + wxPyEndBlockThreads(state); return rval; } // Create a new class for wxPython to use @@ -176,7 +176,7 @@ public: wxBitmap wxPyBitmapDataObject::GetBitmap() { wxBitmap* rval = &wxNullBitmap; - bool doSave = wxPyRestoreThread(); + wxPyTState* state = wxPyBeginBlockThreads(); if (m_myInst.findCallback("GetBitmap")) { PyObject* ro; wxBitmap* ptr; @@ -187,17 +187,17 @@ wxBitmap wxPyBitmapDataObject::GetBitmap() { Py_DECREF(ro); } } - wxPySaveThread(doSave); + wxPyEndBlockThreads(state); return *rval; } void wxPyBitmapDataObject::SetBitmap(const wxBitmap& bitmap) { - bool doSave = wxPyRestoreThread(); + wxPyTState* state = wxPyBeginBlockThreads(); if (m_myInst.findCallback("SetBitmap")) { m_myInst.callCallback(Py_BuildValue("(O)", wxPyConstructObject((void*)&bitmap, "wxBitmap"))); } - wxPySaveThread(doSave); + wxPyEndBlockThreads(state); } // See below in the init function... @@ -293,7 +293,7 @@ public: bool wxPyFileDropTarget::OnDropFiles(wxCoord x, wxCoord y, const wxArrayString& filenames) { bool rval = FALSE; - bool doSave = wxPyRestoreThread(); + wxPyTState* state = wxPyBeginBlockThreads(); PyObject* list = PyList_New(0); for (size_t i=0; i