From 46b5c1b858cab545fa5128624cbfbca82065b7d7 Mon Sep 17 00:00:00 2001 From: David Brochart Date: Mon, 13 May 2024 18:42:44 +0200 Subject: [PATCH] Remove asyncio reader when quitting terminal --- plugins/terminals/fps_terminals/server.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/terminals/fps_terminals/server.py b/plugins/terminals/fps_terminals/server.py index 319f638d..cf3805e4 100644 --- a/plugins/terminals/fps_terminals/server.py +++ b/plugins/terminals/fps_terminals/server.py @@ -40,6 +40,7 @@ def on_output(): self.data_or_disconnect = self.p_out.read(65536).decode() self.event.set() except Exception: + os.close(self.fd) self.loop.remove_reader(self.p_out) self.data_or_disconnect = None self.event.set() @@ -74,3 +75,4 @@ def quit(self, websocket): self.websockets.remove(websocket) if not self.websockets: os.close(self.fd) + self.loop.remove_reader(self.p_out)