wxPyCBInputStream::~wxPyCBInputStream() {
- wxPyBlock_t blocked;
+ wxPyBlock_t blocked = wxPyBlock_t_default;
if (m_block) blocked = wxPyBeginBlockThreads();
Py_XDECREF(m_read);
Py_XDECREF(m_seek);
wxPyCBInputStream* wxPyCBInputStream::create(PyObject *py, bool block) {
- wxPyBlock_t blocked;
+ wxPyBlock_t blocked = wxPyBlock_t_default;
if (block) blocked = wxPyBeginBlockThreads();
PyObject* read = getMethod(py, "read");
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);