]> git.saurik.com Git - wxWidgets.git/blobdiff - utils/wxPython/src/_extras.py
Committing in .
[wxWidgets.git] / utils / wxPython / src / _extras.py
index 068413ea1bf951c108903b888f63170d9b451d14..cdff6809b30ff810c7a7a18817c6f447a3017b08 100644 (file)
@@ -781,7 +781,16 @@ class wxApp(wxPyApp):
 
 #----------------------------------------------------------------------------
 # DO NOT hold any other references to this object.  This is how we know when
 
 #----------------------------------------------------------------------------
 # DO NOT hold any other references to this object.  This is how we know when
-# to cleanup system resources that wxWin is holding...
+# to cleanup system resources that wxWin is holding.  When this module is
+# 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()
 #----------------------------------------------------------------------------
 
 __cleanMeUp = __wxPyCleanup()
 #----------------------------------------------------------------------------