A little different fix for how to delay the call to __wxCleanup

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14188 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2002-02-13 22:01:04 +00:00
parent 154747f5be
commit c0fbf24ba6
2 changed files with 24 additions and 22 deletions

View File

@@ -775,19 +775,20 @@ class wxPyWidgetTester(wxApp):
# unloaded, the refcount on __cleanMeUp goes to zero and it calls the # unloaded, the refcount on __cleanMeUp goes to zero and it calls the
# wxApp_CleanUp function. # wxApp_CleanUp function.
## class __wxPyCleanup: class __wxPyCleanup:
## def __init__(self): def __init__(self):
## self.cleanup = wxc.wxApp_CleanUp self.cleanup = wxc.wxApp_CleanUp
## def __del__(self): def __del__(self):
## self.cleanup() self.cleanup()
## __cleanMeUp = __wxPyCleanup() sys.__wxPythonCleanup = __wxPyCleanup()
if sys.version[0] == '2': ## # another possible solution, but it gets called too eary...
import atexit ## if sys.version[0] == '2':
atexit.register(wxc.wxApp_CleanUp) ## import atexit
else: ## atexit.register(wxc.wxApp_CleanUp)
sys.exitfunc = wxc.wxApp_CleanUp ## else:
## sys.exitfunc = wxc.wxApp_CleanUp
#---------------------------------------------------------------------------- #----------------------------------------------------------------------------

View File

@@ -1668,19 +1668,20 @@ class wxPyWidgetTester(wxApp):
# unloaded, the refcount on __cleanMeUp goes to zero and it calls the # unloaded, the refcount on __cleanMeUp goes to zero and it calls the
# wxApp_CleanUp function. # wxApp_CleanUp function.
## class __wxPyCleanup: class __wxPyCleanup:
## def __init__(self): def __init__(self):
## self.cleanup = wxc.wxApp_CleanUp self.cleanup = wxc.wxApp_CleanUp
## def __del__(self): def __del__(self):
## self.cleanup() self.cleanup()
## __cleanMeUp = __wxPyCleanup() sys.__wxPythonCleanup = __wxPyCleanup()
if sys.version[0] == '2': ## # another possible solution, but it gets called too eary...
import atexit ## if sys.version[0] == '2':
atexit.register(wxc.wxApp_CleanUp) ## import atexit
else: ## atexit.register(wxc.wxApp_CleanUp)
sys.exitfunc = wxc.wxApp_CleanUp ## else:
## sys.exitfunc = wxc.wxApp_CleanUp
#---------------------------------------------------------------------------- #----------------------------------------------------------------------------