diff --git a/src/core_ex.cpp b/src/core_ex.cpp index d48f1c0a..6ddb0aa3 100644 --- a/src/core_ex.cpp +++ b/src/core_ex.cpp @@ -93,7 +93,10 @@ void wxPyPreInit(PyObject* moduleDict) wxApp::CheckBuildOptions(WX_BUILD_OPTIONS_SIGNATURE, "wxPython"); } - +void _wxPyCleanup() +{ + wxEntryCleanup(); +} PyObject* wxAssertionError = NULL; // Exception object raised for wxASSERT failures diff --git a/src/core_ex.py b/src/core_ex.py index 8ea5c456..6ced1e97 100644 --- a/src/core_ex.py +++ b/src/core_ex.py @@ -97,6 +97,13 @@ def deprecated(item, msg='', useName=False): else: raise TypeError("unsupported type %s" % type(item)) +class __wxPyCleanup: + def __init__(self): + self.cleanup = _core._wxPyCleanup + def __del__(self): + self.cleanup() + +_sys.__wxPythonCleanup = __wxPyCleanup() def deprecatedMsg(msg): """