From c261ca2447a84f2238755c93acc1134693166e83 Mon Sep 17 00:00:00 2001 From: atse Date: Thu, 6 Jul 2023 12:42:22 +0800 Subject: [PATCH] Disconnect client too on close --- pytec/tec_qt.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pytec/tec_qt.py b/pytec/tec_qt.py index e2bbc90..7c34377 100644 --- a/pytec/tec_qt.py +++ b/pytec/tec_qt.py @@ -138,6 +138,8 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow): async def closeEvent(self, event): if self.client_watcher is not None: self.client_watcher.stop_watching() + if self.tec_client is not None: + await self.tec_client.disconnect() @asyncSlot() async def connect(self):