From a8ddf97d28af65a1781fa3d05f43816b88dc536e Mon Sep 17 00:00:00 2001 From: Almar Klein Date: Wed, 13 Nov 2024 14:00:46 +0100 Subject: [PATCH] Dont stop asyncio loop when interactive (#19) --- rendercanvas/asyncio.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rendercanvas/asyncio.py b/rendercanvas/asyncio.py index 7ef7526..a3c283a 100644 --- a/rendercanvas/asyncio.py +++ b/rendercanvas/asyncio.py @@ -40,7 +40,7 @@ def _rc_stop(self): class AsyncioLoop(BaseLoop): _TimerClass = AsyncioTimer _the_loop = None - _is_interactive = False + _is_interactive = True # When run() is not called, assume interactive @property def _loop(self): @@ -67,6 +67,7 @@ def _rc_run(self): def _rc_stop(self): if not self._is_interactive: self._loop.stop() + self._is_interactive = True def _rc_call_soon(self, callback, *args): self._loop.call_soon(callback, *args)