mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-02 09:52:27 -04:00
fix exception when mini-task explicitly removes itself
This commit is contained in:
parent
d6d497106a
commit
9e5e3edc5b
@ -26,7 +26,10 @@ class MiniTaskManager:
|
||||
self.taskList.append(task)
|
||||
|
||||
def remove(self, task):
|
||||
self.taskList.remove(task)
|
||||
try:
|
||||
self.taskList.remove(task)
|
||||
except ValueError:
|
||||
pass
|
||||
|
||||
def __executeTask(self, task):
|
||||
return task(task)
|
||||
@ -44,7 +47,10 @@ class MiniTaskManager:
|
||||
|
||||
else:
|
||||
# Remove the task
|
||||
self.taskList.remove(task)
|
||||
try:
|
||||
self.taskList.remove(task)
|
||||
except ValueError:
|
||||
pass
|
||||
# Do not increment the iterator
|
||||
continue
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user