X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/53aa7709e08bb3cdaa8ec5c4977f32e817aff7d6..d0ee33f5c6908b4ac5e1364381f0ef00942e3936:/wxPython/src/mac/calendar_wrap.cpp?ds=sidebyside diff --git a/wxPython/src/mac/calendar_wrap.cpp b/wxPython/src/mac/calendar_wrap.cpp index 098a24918f..2f1e3d24b9 100644 --- a/wxPython/src/mac/calendar_wrap.cpp +++ b/wxPython/src/mac/calendar_wrap.cpp @@ -1037,7 +1037,8 @@ SWIG_Python_TypeError(const char *type, PyObject *obj) PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s' is received", type, otype); } - Py_DECREF(str); + if (str) + Py_DECREF(str); return; } } @@ -1582,7 +1583,7 @@ static PyObject *wxCalendarCtrl_HitTest(wxCalendarCtrl *self,wxPoint const &pos) wxDateTime* date = new wxDateTime; wxDateTime::WeekDay wd; wxCalendarHitTestResult result = self->HitTest(pos, date, &wd); - bool blocked = wxPyBeginBlockThreads(); + wxPyBlock_t blocked = wxPyBeginBlockThreads(); PyObject* tup = PyTuple_New(3); PyTuple_SET_ITEM(tup, 0, PyInt_FromLong(result)); PyTuple_SET_ITEM(tup, 1, wxPyConstructObject(date, wxT("wxDateTime"), 1));