--- a/eric6/Utilities/BackgroundService.py Sat Jul 03 11:47:48 2021 +0200 +++ b/eric6/Utilities/BackgroundService.py Sat Sep 04 11:34:54 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' @@ -426,9 +426,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: @@ -481,9 +481,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()