mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 02:15:43 -04:00
safe to call destroy() multiple times
This commit is contained in:
parent
083827c649
commit
9c547793a1
@ -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()
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user