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:
Robin Dunn
1999-11-23 20:36:23 +00:00
parent 80eab46937
commit b731267565
6 changed files with 129 additions and 110 deletions

View File

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