Nicer resetting of _loop_kicking_operator_running
This commit is contained in:
parent
eb77461ca0
commit
56137c485f
@ -94,7 +94,6 @@ def erase_async_loop():
|
|||||||
|
|
||||||
loop = asyncio.get_event_loop()
|
loop = asyncio.get_event_loop()
|
||||||
loop.stop()
|
loop.stop()
|
||||||
_loop_kicking_operator_running = False
|
|
||||||
|
|
||||||
|
|
||||||
class AsyncLoopModalOperator(bpy.types.Operator):
|
class AsyncLoopModalOperator(bpy.types.Operator):
|
||||||
@ -104,6 +103,14 @@ class AsyncLoopModalOperator(bpy.types.Operator):
|
|||||||
timer = None
|
timer = None
|
||||||
log = logging.getLogger(__name__ + '.AsyncLoopModalOperator')
|
log = logging.getLogger(__name__ + '.AsyncLoopModalOperator')
|
||||||
|
|
||||||
|
def __del__(self):
|
||||||
|
global _loop_kicking_operator_running
|
||||||
|
|
||||||
|
# This can be required when the operator is running while Blender
|
||||||
|
# (re)loads a file. The operator then doesn't get the chance to
|
||||||
|
# finish the async tasks, hence stop_after_this_kick is never True.
|
||||||
|
_loop_kicking_operator_running = False
|
||||||
|
|
||||||
def execute(self, context):
|
def execute(self, context):
|
||||||
return self.invoke(context, None)
|
return self.invoke(context, None)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user