From 5ce281e99b7990ff9fb14d11ed6ec4ad04f9af22 Mon Sep 17 00:00:00 2001 From: misyaguziya <53165965+misyaguziya@users.noreply.github.com> Date: Tue, 28 Oct 2025 23:02:16 +0900 Subject: [PATCH] =?UTF-8?q?Main.start=E3=82=92=E7=B0=A1=E7=B4=A0=E5=8C=96?= =?UTF-8?q?=E3=81=97=E3=80=81=E5=8F=97=E4=BF=A1/=E3=83=8F=E3=83=B3?= =?UTF-8?q?=E3=83=89=E3=83=A9=E3=82=B9=E3=83=AC=E3=83=83=E3=83=89=E3=81=AE?= =?UTF-8?q?=E8=B5=B7=E5=8B=95=E3=82=92=E5=89=8A=E9=99=A4=E3=81=97=E3=81=A6?= =?UTF-8?q?=E3=83=A1=E3=82=A4=E3=83=B3=E3=83=AB=E3=83=BC=E3=83=97=E3=81=A7?= =?UTF-8?q?=E7=A8=BC=E5=83=8D=E3=82=92=E7=B6=AD=E6=8C=81=E3=80=82KeyboardI?= =?UTF-8?q?nterrupt=E3=81=A7stop=E3=82=92=E5=91=BC=E3=81=B3=E5=87=BA?= =?UTF-8?q?=E3=81=99=E3=82=88=E3=81=86=E3=81=AB=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src-python/mainloop.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src-python/mainloop.py b/src-python/mainloop.py index f4c3a451..84bc3919 100644 --- a/src-python/mainloop.py +++ b/src-python/mainloop.py @@ -551,9 +551,12 @@ class Main: self._threads.append(th_handler) def start(self) -> None: - """Start receiver and handler threads.""" - self.startReceiver() - self.startHandler() + """Start the main loop to keep the program running.""" + try: + while not self._stop_event.is_set(): + time.sleep(1) + except KeyboardInterrupt: + self.stop() def stop(self, wait: float = 2.0) -> None: """Signal threads to stop and wait for them to finish.