eric7/Utilities/BackgroundService.py

branch
eric7
changeset 8478
b95aa969efdf
parent 8456
00a7d3bd87dc
child 8881
54e42bc2437a
diff -r 81e25fe19818 -r b95aa969efdf eric7/Utilities/BackgroundService.py
--- 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()

eric ide

mercurial