mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 02:15:43 -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)
|
self.taskList.append(task)
|
||||||
|
|
||||||
def remove(self, task):
|
def remove(self, task):
|
||||||
|
try:
|
||||||
self.taskList.remove(task)
|
self.taskList.remove(task)
|
||||||
|
except ValueError:
|
||||||
|
pass
|
||||||
|
|
||||||
def __executeTask(self, task):
|
def __executeTask(self, task):
|
||||||
return task(task)
|
return task(task)
|
||||||
@ -44,7 +47,10 @@ class MiniTaskManager:
|
|||||||
|
|
||||||
else:
|
else:
|
||||||
# Remove the task
|
# Remove the task
|
||||||
|
try:
|
||||||
self.taskList.remove(task)
|
self.taskList.remove(task)
|
||||||
|
except ValueError:
|
||||||
|
pass
|
||||||
# Do not increment the iterator
|
# Do not increment the iterator
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user