X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/be43cc441addda05d1590e0ce983a84d949376da..9a9e73f6fdc119b856b97962abeb9be38b55683d:/wxPython/src/_extras.py diff --git a/wxPython/src/_extras.py b/wxPython/src/_extras.py index 2c27bf0584..f1733cee51 100644 --- a/wxPython/src/_extras.py +++ b/wxPython/src/_extras.py @@ -775,19 +775,20 @@ class wxPyWidgetTester(wxApp): # unloaded, the refcount on __cleanMeUp goes to zero and it calls the # wxApp_CleanUp function. -## class __wxPyCleanup: -## def __init__(self): -## self.cleanup = wxc.wxApp_CleanUp -## def __del__(self): -## self.cleanup() - -## __cleanMeUp = __wxPyCleanup() - -if sys.version[0] == '2': - import atexit - atexit.register(wxc.wxApp_CleanUp) -else: - sys.exitfunc = wxc.wxApp_CleanUp +class __wxPyCleanup: + def __init__(self): + self.cleanup = wxc.wxApp_CleanUp + def __del__(self): + self.cleanup() + +sys.__wxPythonCleanup = __wxPyCleanup() + +## # another possible solution, but it gets called too early... +## if sys.version[0] == '2': +## import atexit +## atexit.register(wxc.wxApp_CleanUp) +## else: +## sys.exitfunc = wxc.wxApp_CleanUp #----------------------------------------------------------------------------