a bug fix in helpers for ref-counting callbacks
some generated code updates git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4667 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -382,12 +382,14 @@ void wxPyCallback::EventThunker(wxEvent& event) {
|
||||
wxPyCallbackHelper::wxPyCallbackHelper() {
|
||||
m_self = NULL;
|
||||
m_lastFound = NULL;
|
||||
m_incRef = FALSE;
|
||||
}
|
||||
|
||||
|
||||
wxPyCallbackHelper::~wxPyCallbackHelper() {
|
||||
bool doSave = wxPyRestoreThread();
|
||||
Py_XDECREF(m_self);
|
||||
if (m_incRef)
|
||||
Py_XDECREF(m_self);
|
||||
wxPySaveThread(doSave);
|
||||
}
|
||||
|
||||
@@ -401,6 +403,7 @@ wxPyCallbackHelper::wxPyCallbackHelper(const wxPyCallbackHelper& other) {
|
||||
|
||||
void wxPyCallbackHelper::setSelf(PyObject* self, int incref) {
|
||||
m_self = self;
|
||||
m_incRef = incref;
|
||||
if (incref)
|
||||
Py_INCREF(m_self);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user