From 21defc2e55e5df9520976062401cb1f7f663061f Mon Sep 17 00:00:00 2001 From: Dpeta <69427753+Dpeta@users.noreply.github.com> Date: Thu, 20 Apr 2023 22:42:49 +0200 Subject: [PATCH] Don't call killApp() on aboutToQuit, only check IRC thread instead. Qt6.5 seems to call aboutToQuit a whole bunch of times? --- pesterchum.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/pesterchum.py b/pesterchum.py index 9e6a66a..d4e8332 100755 --- a/pesterchum.py +++ b/pesterchum.py @@ -3497,6 +3497,7 @@ class PesterWindow(MovingWindow): @QtCore.pyqtSlot() def killApp(self): + PchumLog.info("killApp() called") self.disconnectIRC.emit() self.parent.trayicon.hide() self.app.quit() @@ -4065,10 +4066,13 @@ class MainProgram(QtCore.QObject): self.app.aboutToQuit.connect(self.death) def death(self): - # app murder in progress - # print("death inbound") - if hasattr(self, "widget"): - self.widget.killApp() + """app murder in progress, kill the IRC thread if it didnt die already.""" + PchumLog.debug("death inbound") + if hasattr(self, "irc"): + if self.irc: + if self.irc.isRunning(): + PchumLog.debug("Calling exit() on IRC thread.") + self.irc.exit() # def lastWindow(self): # print("all windows closed")