# 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 eary...
+## if sys.version[0] == '2':
+## import atexit
+## atexit.register(wxc.wxApp_CleanUp)
+## else:
+## sys.exitfunc = wxc.wxApp_CleanUp
#----------------------------------------------------------------------------