Spawn.vala
authorAlan Knowles <alan@roojs.com>
Mon, 29 Aug 2016 08:35:53 +0000 (16:35 +0800)
committerAlan Knowles <alan@roojs.com>
Mon, 29 Aug 2016 08:35:53 +0000 (16:35 +0800)
Spawn.vala

index 08032c1..a25c2da 100644 (file)
@@ -426,7 +426,9 @@ public class Spawn : Object
     {
         string prop = (ch == this.out_ch) ? "output" : "stderr";
        // print("prop: " + prop);
-
+        if (this.pid < 0) {
+            return; // spawn complete + closed... can't read any more.
+        }
         
         //print(JSON.stringify(ch, null,4));
         while (true) {