mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2026-01-06 03:50:06 +01:00
Acquire the GIL for INCREF's where needed
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@70901 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -15,18 +15,16 @@ IMPLEMENT_ABSTRACT_CLASS(wxPyCallback, wxEvtHandler);
|
||||
|
||||
wxPyCallback::wxPyCallback(PyObject* func) {
|
||||
m_func = func;
|
||||
Py_INCREF(m_func);
|
||||
wxPyBLOCK_THREADS( Py_INCREF(m_func) );
|
||||
}
|
||||
|
||||
wxPyCallback::wxPyCallback(const wxPyCallback& other) {
|
||||
m_func = other.m_func;
|
||||
Py_INCREF(m_func);
|
||||
wxPyBLOCK_THREADS( Py_INCREF(m_func) );
|
||||
}
|
||||
|
||||
wxPyCallback::~wxPyCallback() {
|
||||
wxPyBlock_t blocked = wxPyBeginBlockThreads();
|
||||
Py_DECREF(m_func);
|
||||
wxPyEndBlockThreads(blocked);
|
||||
wxPyBLOCK_THREADS( Py_DECREF(m_func) );
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user