eric6/Utilities/BackgroundService.py

changeset 8474
4b9f6bd71a99
parent 8309
10aa9235b817
child 8576
fe1957c69854
diff -r 52e96cd0730d -r 4b9f6bd71a99 eric6/Utilities/BackgroundService.py
--- a/eric6/Utilities/BackgroundService.py	Sun Jul 18 14:28:27 2021 +0200
+++ b/eric6/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'
@@ -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()

eric ide

mercurial