def _stop(self):
"""
Stop this AnimationLoop
Shuts down the loop and triggers cleanup tasks.
"""
if not self.running:
return False
self.running = False
for layer in self.layers[::-1]:
await self.remove_layer(layer)
if self._anim_task is not None and not self._anim_task.done():
self._anim_task.cancel()
await asyncio.wait([self._anim_task], return_when=futures.ALL_COMPLETED)
self._logger.info("AnimationLoop stopped")
评论列表
文章目录