Fixed an issue in the debug client causing it to enter an inifinite loop if the frontend crashed.

Sun, 24 Dec 2017 15:19:00 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sun, 24 Dec 2017 15:19:00 +0100
changeset 6040
dcf8c50ed06a
parent 6039
d52e90757805
child 6041
415d36b1d3a6
child 6042
3ac954550a0a

Fixed an issue in the debug client causing it to enter an inifinite loop if the frontend crashed.

DebugClients/Python/DebugClientBase.py file | annotate | diff | comparison | revisions
Documentation/Help/source.qch file | annotate | diff | comparison | revisions
Documentation/Source/eric6.DebugClients.Python.DebugClientBase.html file | annotate | diff | comparison | revisions
--- a/DebugClients/Python/DebugClientBase.py	Sat Dec 23 16:42:21 2017 +0100
+++ b/DebugClients/Python/DebugClientBase.py	Sun Dec 24 15:19:00 2017 +0100
@@ -1014,19 +1014,24 @@
         Public method called when there is data ready to be read.
         
         @param stream file like object that has data to be written
+        @return flag indicating an error condition
+        @rtype bool
         """
+        error = False
+        
+        self.lockClient()
         try:
-            self.lockClient()
             command = stream.readCommand()
-            self.unlockClient()
         except Exception:
-            return
+            error = True
+        self.unlockClient()
 
-        if len(command) == 0:
+        if len(command) == 0 or error:
             self.sessionClose()
-            return
+        else:
+            self.handleJsonCommand(command)
         
-        self.handleJsonCommand(command)
+        return error
 
     def writeReady(self, stream):
         """
@@ -1079,7 +1084,9 @@
                 continue
 
             if self.readstream in rrdy:
-                self.readReady(self.readstream)
+                error = self.readReady(self.readstream)
+                if error:
+                    break
 
             if self.writestream in wrdy:
                 self.writeReady(self.writestream)
Binary file Documentation/Help/source.qch has changed
--- a/Documentation/Source/eric6.DebugClients.Python.DebugClientBase.html	Sat Dec 23 16:42:21 2017 +0100
+++ b/Documentation/Source/eric6.DebugClients.Python.DebugClientBase.html	Sun Dec 24 15:19:00 2017 +0100
@@ -688,6 +688,16 @@
 <dd>
 file like object that has data to be written
 </dd>
+</dl><dl>
+<dt>Returns:</dt>
+<dd>
+flag indicating an error condition
+</dd>
+</dl><dl>
+<dt>Return Type:</dt>
+<dd>
+bool
+</dd>
 </dl><a NAME="DebugClientBase.run_call" ID="DebugClientBase.run_call"></a>
 <h4>DebugClientBase.run_call</h4>
 <b>run_call</b>(<i>scriptname, func, *args</i>)

eric ide

mercurial