[gedit/gnome-3-8] external tools: fix stop button



commit 37b252e4315ff028d90ce34ac97cb6ae3ecc6e08
Author: Ignacio Casal Quinteiro <icq gnome org>
Date:   Mon Apr 22 21:23:48 2013 +0200

    external tools: fix stop button
    
    https://bugzilla.gnome.org/show_bug.cgi?id=698579

 plugins/externaltools/tools/capture.py |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/plugins/externaltools/tools/capture.py b/plugins/externaltools/tools/capture.py
index a8f2d41..db98da7 100644
--- a/plugins/externaltools/tools/capture.py
+++ b/plugins/externaltools/tools/capture.py
@@ -206,13 +206,17 @@ class Capture(GObject.Object):
         if self.idle_write_id:
             GLib.source_remove(self.idle_write_id)
             self.idle_write_id = 0
+            if self.pipe:
+                self.pipe.stdin.close()
 
         if self.out_channel_id:
+            GLib.source_remove(self.out_channel_id)
             self.out_channel.shutdown(True)
             self.out_channel = None
             self.out_channel_id = 0
 
         if self.err_channel_id:
+            GLib.source_remove(self.err_channel_id)
             self.err_channel.shutdown(True)
             self.err_channel = None
             self.err_channel = 0
@@ -224,6 +228,8 @@ class Capture(GObject.Object):
             else:
                 os.kill(self.pipe.pid, signal.SIGKILL)
 
+            self.pipe = None
+
     def emit_end_execute(self, error_code):
         self.emit('end-execute', error_code)
         return False


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