]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/src/_extras.py
applied doc patch for wxPostEvent().
[wxWidgets.git] / wxPython / src / _extras.py
index 2c27bf0584e218b395a551e73a78c0aeaceb4b36..f1733cee51000b6ec80ea4384f620f4b33b88ea8 100644 (file)
@@ -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
 
 
 #----------------------------------------------------------------------------