X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/debe38c93368f632c8b62b98112a41a1de71f73e..908f8fc481c0503bf8be5002e5d5208666da7649:/wxPython/src/helpers.cpp diff --git a/wxPython/src/helpers.cpp b/wxPython/src/helpers.cpp index 5497d2f5b1..dfafce7dc5 100644 --- a/wxPython/src/helpers.cpp +++ b/wxPython/src/helpers.cpp @@ -1724,7 +1724,7 @@ PyObject* wxPyCBH_callCallbackObj(const wxPyCallbackHelper& cbh, PyObject* argTu void wxPyCBH_delete(wxPyCallbackHelper* cbh) { - if (cbh->m_incRef) { + if (cbh->m_incRef && Py_IsInitialized()) { wxPyBlock_t blocked = wxPyBeginBlockThreads(); Py_XDECREF(cbh->m_self); Py_XDECREF(cbh->m_class);