Wed, 21 Jul 2021 17:52:39 +0200
BackgroundService: did some small changes that (hopefully) cure a nasty issue seen every now and than.
(grafted from 4b9f6bd71a99a330155c44c686d811f8fe328014)
eric7/Utilities/BackgroundService.py | file | annotate | diff | comparison | revisions |
--- a/eric7/Utilities/BackgroundService.py Sun Jul 25 16:54:08 2021 +0200 +++ b/eric7/Utilities/BackgroundService.py Wed Jul 21 17:52:39 2021 +0200 @@ -46,6 +46,8 @@ @param parent reference to the parent object @type QObject """ + super().__init__(parent) + self.processes = {} self.connections = {} self.isWorking = None @@ -53,8 +55,6 @@ self.__queue = [] self.services = {} - super().__init__(parent) - networkInterface = Preferences.getDebugger("NetworkInterface") if networkInterface == "all" or '.' in networkInterface: self.hostAddress = '127.0.0.1' @@ -428,9 +428,9 @@ self.isWorking = None self.connections[lang] = connection connection.readyRead.connect( - lambda x=lang: self.__receive(x)) + lambda: self.__receive(lang)) connection.disconnected.connect( - lambda x=lang: self.on_disconnectSocket(x)) + lambda: self.on_disconnectSocket(lang)) for (fx, lng), args in self.services.items(): if lng == lang: @@ -483,9 +483,10 @@ self.close() for connection in self.connections.values(): - # Prevent calling of on_disconnectSocket - connection.blockSignals(True) + connection.readyRead.disconnect() + connection.disconnected.disconnect() connection.close() + connection.deleteLater() for process, _interpreter in self.processes.values(): process.close()