diff --git a/wxPython/src/gtk/_gdi_wrap.cpp b/wxPython/src/gtk/_gdi_wrap.cpp index 72a8fe030a..68a9683ecd 100644 --- a/wxPython/src/gtk/_gdi_wrap.cpp +++ b/wxPython/src/gtk/_gdi_wrap.cpp @@ -1089,6 +1089,7 @@ static PyObject *_wrap_new_NamedColour(PyObject *self, PyObject *args, PyObject temp1 = True; } { + if (!wxPyCheckForApp()) SWIG_fail; PyThreadState* __tstate = wxPyBeginAllowThreads(); result = (wxColour *)new wxColour((wxString const &)*arg1); diff --git a/wxPython/src/mac/_gdi_wrap.cpp b/wxPython/src/mac/_gdi_wrap.cpp index 9bd107d566..6f5bfe39a5 100644 --- a/wxPython/src/mac/_gdi_wrap.cpp +++ b/wxPython/src/mac/_gdi_wrap.cpp @@ -1094,6 +1094,7 @@ static PyObject *_wrap_new_NamedColour(PyObject *self, PyObject *args, PyObject temp1 = True; } { + if (!wxPyCheckForApp()) SWIG_fail; PyThreadState* __tstate = wxPyBeginAllowThreads(); result = (wxColour *)new wxColour((wxString const &)*arg1);