make sure garbage collection is enabled when Python breaks to the prompt

This commit is contained in:
Darren Ranalli 2008-11-14 19:05:03 +00:00
parent 0d3349bac0
commit 69985789f1

View File

@ -2306,7 +2306,13 @@ class ShowBase(DirectObject.DirectObject):
self.startDirect(fWantDirect = fDirect, fWantTk = fTk, fWantWx = fWx)
def run(self):
self.taskMgr.run()
try:
self.taskMgr.run()
except:
# make sure gc is enabled when we break out to the prompt
gc.enable()
else:
gc.enable()
def _garbageCollect(self, task=None):
# enable automatic garbage collection