X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2abc0a0f9bf1a1c4fb3e807be687850949603e5c..af9d1662d9618c099b1a0d606a8f14dfd1e86b06:/utils/wxPython/src/_extras.py diff --git a/utils/wxPython/src/_extras.py b/utils/wxPython/src/_extras.py index 068413ea1b..cdff6809b3 100644 --- a/utils/wxPython/src/_extras.py +++ b/utils/wxPython/src/_extras.py @@ -781,7 +781,16 @@ class wxApp(wxPyApp): #---------------------------------------------------------------------------- # 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() #----------------------------------------------------------------------------