Fix bug in killing debug thread when closing Beremiz window
authorlaurent
Mon, 27 Feb 2012 16:51:43 +0100
changeset 696 9265781619b7
parent 694 fb55fbee202c
child 697 3e83853081d4
Fix bug in killing debug thread when closing Beremiz window
plugger.py
--- a/plugger.py	Tue Feb 21 22:36:35 2012 +0100
+++ b/plugger.py	Mon Feb 27 16:51:43 2012 +0100
@@ -1815,11 +1815,12 @@
         self.DebugThread = None
 
     def KillDebugThread(self):
+        tmp_debugthread = self.DebugThread
         self.debug_break = True
-        if self.DebugThread is not None:
+        if tmp_debugthread is not None:
             self.logger.writeyield(_("Stopping debugger...\n"))
-            self.DebugThread.join(timeout=5)
-            if self.DebugThread.isAlive() and self.logger:
+            tmp_debugthread.join(timeout=5)
+            if tmp_debugthread.isAlive() and self.logger:
                 self.logger.write_warning(_("Couldn't stop debugger.\n"))
             else:
                 self.logger.write(_("Debugger stopped.\n"))