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:
Robin Dunn
2012-03-14 20:56:04 +00:00
parent e9a0da2888
commit f525cad436
8 changed files with 61 additions and 47 deletions

View File

@@ -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) );
}