Browse Source

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

Darren Ranalli 17 years ago
parent
commit
69985789f1
1 changed files with 7 additions and 1 deletions
  1. 7 1
      direct/src/showbase/ShowBase.py

+ 7 - 1
direct/src/showbase/ShowBase.py

@@ -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