safe to call destroy() multiple times

This commit is contained in:
David Rose 2008-10-24 18:46:09 +00:00
parent 083827c649
commit 9c547793a1
2 changed files with 7 additions and 0 deletions

View File

@ -130,6 +130,8 @@ class TaskManager:
self.setProfileTasks(ConfigVariableBool('profile-task-spikes', 0).getValue())
def destroy(self):
# This should be safe to call multiple times.
self._frameProfileQueue.clear()
self.mgr.cleanup()

View File

@ -409,6 +409,7 @@ class TaskManager:
_DidTests = False
def __init__(self):
self._destroyed = False
self.running = 0
self.stepping = 0
self.taskList = []
@ -466,6 +467,9 @@ class TaskManager:
pass
def destroy(self):
if self._destroyed:
return
self._frameProfileQueue.clear()
if self._doLaterTask:
self._doLaterTask.remove()
@ -477,6 +481,7 @@ class TaskManager:
del self.__doLaterList
del self.pendingTaskDict
del self.taskList
self._destroyed = True
def setStepping(self, value):
self.stepping = value