[gnome-builder/wip/chergert/debugger: 40/46] gdb: cleanup client instance when process exits



commit 83212ae4dfd4d3065a8765ebf70d5f26dc3a4bfe
Author: Christian Hergert <chergert redhat com>
Date:   Sat Mar 25 00:43:50 2017 -0700

    gdb: cleanup client instance when process exits

 plugins/gdb/gdb_plugin.py |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)
---
diff --git a/plugins/gdb/gdb_plugin.py b/plugins/gdb/gdb_plugin.py
index f9fb9c8..b824c15 100644
--- a/plugins/gdb/gdb_plugin.py
+++ b/plugins/gdb/gdb_plugin.py
@@ -44,10 +44,6 @@ class GdbDebugger(Ide.Object, Ide.Debugger):
     # process over stdin/stdout.
     client = None
 
-    def __del__(self):
-        if self.client:
-            self.client.stop_listening()
-
     def do_get_name(self):
         return 'GNU Debugger'
 
@@ -121,7 +117,9 @@ class GdbDebugger(Ide.Object, Ide.Debugger):
             print(repr(ex))
 
     def on_runner_exited(self, runner):
-        self.client.stop_listening()
+        client = self.client
+        self.client = None
+        client.stop_listening()
 
     def on_client_log(self, client, message):
         print('>>>', message[:-1])


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]