mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
fix for closing
This commit is contained in:
@@ -198,13 +198,14 @@ class MessagePump:
|
||||
return
|
||||
|
||||
self._closing = True
|
||||
|
||||
await self._message_queue.put(MessagePriority(None))
|
||||
|
||||
for task in self._child_tasks:
|
||||
task.cancel()
|
||||
await task
|
||||
self._child_tasks.clear()
|
||||
if self._task is not None:
|
||||
# Ensure everything is closed before returning
|
||||
await self._task
|
||||
|
||||
def start_messages(self) -> None:
|
||||
self._task = asyncio.create_task(self.process_messages())
|
||||
|
||||
Reference in New Issue
Block a user