X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9416aa89ca06d0fb20b1002e026d2c7ac7aa6a17..4649b5eded522cdc6d76aae074f98a2c162fd648:/wxPython/src/streams.i?ds=inline diff --git a/wxPython/src/streams.i b/wxPython/src/streams.i index 57daa51833..4426a09a2d 100644 --- a/wxPython/src/streams.i +++ b/wxPython/src/streams.i @@ -246,7 +246,7 @@ protected: if (bufsize == 0) return 0; - bool doSave = wxPyRestoreThread(); + wxPyTState* state = wxPyBeginBlockThreads(); PyObject* arglist = Py_BuildValue("(i)", bufsize); PyObject* result = PyEval_CallObject(read, arglist); Py_DECREF(arglist); @@ -264,7 +264,7 @@ protected: } else m_lasterror = wxSTREAM_READ_ERROR; - wxPySaveThread(doSave); + wxPyEndBlockThreads(state); m_lastcount = o; return o; } @@ -275,17 +275,17 @@ protected: } virtual off_t OnSysSeek(off_t off, wxSeekMode mode){ - bool doSave = wxPyRestoreThread(); + wxPyTState* state = wxPyBeginBlockThreads(); PyObject*arglist = Py_BuildValue("(ii)", off, mode); PyObject*result = PyEval_CallObject(seek, arglist); Py_DECREF(arglist); Py_XDECREF(result); - wxPySaveThread(doSave); + wxPyEndBlockThreads(state); return OnSysTell(); } virtual off_t OnSysTell() const{ - bool doSave = wxPyRestoreThread(); + wxPyTState* state = wxPyBeginBlockThreads(); PyObject* arglist = Py_BuildValue("()"); PyObject* result = PyEval_CallObject(tell, arglist); Py_DECREF(arglist); @@ -294,7 +294,7 @@ protected: o = PyInt_AsLong(result); Py_DECREF(result); }; - wxPySaveThread(doSave); + wxPyEndBlockThreads(state); return o; } @@ -304,12 +304,12 @@ protected: public: ~wxPyCBInputStream() { - bool doSave = wxPyRestoreThread(); + wxPyTState* state = wxPyBeginBlockThreads(); Py_XDECREF(py); Py_XDECREF(read); Py_XDECREF(seek); Py_XDECREF(tell); - wxPySaveThread(doSave); + wxPyEndBlockThreads(state); } virtual size_t GetSize() {