Spawn.vala
[gitlive] / Spawn.vala
index af6bd4a..92f9259 100644 (file)
@@ -346,16 +346,20 @@ public class Spawn : Object
             Process.close_pid(this.pid); // hopefully kills it..
             this.pid = -1;
         }
-        if (this.in_ch)  this.in_ch.shutdown(true);
-        if (this.out_ch)  this.out_ch.shutdown(true);
-        if (this.err_ch)  this.err_ch.shutdown(true);
+        try {
+            if (this.in_ch != null)  this.in_ch.shutdown(true);
+            if (this.out_ch != null)  this.out_ch.shutdown(true);
+            if (this.err_ch != null)  this.err_ch.shutdown(true);
+        } catch (Error e) {
+            // error shutting donw.
+        }
         // blank out channels
         this.in_ch = null;
         this.err_ch = null;
         this.out_ch = null;
         // rmeove listeners !! important otherwise we kill the CPU
-        if (this.err_src > -1 ) GLib.source_remove(this.err_src);
-        if (this.out_src > -1 ) GLib.source_remove(this.out_src);
+        //if (this.err_src > -1 ) GLib.source_remove(this.err_src);
+        //if (this.out_src > -1 ) GLib.source_remove(this.out_src);
         this.err_src = -1;
         this.out_src = -1;