]> git.saurik.com Git - wxWidgets.git/commitdiff
A little different fix for how to delay the call to __wxCleanup
authorRobin Dunn <robin@alldunn.com>
Wed, 13 Feb 2002 22:01:04 +0000 (22:01 +0000)
committerRobin Dunn <robin@alldunn.com>
Wed, 13 Feb 2002 22:01:04 +0000 (22:01 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14188 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

wxPython/src/_extras.py
wxPython/src/msw/wx.py

index 2c27bf0584e218b395a551e73a78c0aeaceb4b36..f52dadab80005922070618aee35a3f79933c0ef2 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 eary...
+## if sys.version[0] == '2':
+##     import atexit
+##     atexit.register(wxc.wxApp_CleanUp)
+## else:
+##     sys.exitfunc = wxc.wxApp_CleanUp
 
 
 #----------------------------------------------------------------------------
index 9a7a30f149e50f93ebf792ecb9ad503676704ae7..d72f84b8a06066cd009e814b6b8a6b738974908c 100644 (file)
@@ -1668,19 +1668,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 eary...
+## if sys.version[0] == '2':
+##     import atexit
+##     atexit.register(wxc.wxApp_CleanUp)
+## else:
+##     sys.exitfunc = wxc.wxApp_CleanUp
 
 
 #----------------------------------------------------------------------------