Prune subprocess event registrations after exited/signalled.
authorMatt Birkholz <puck@birchwood-abbey.net>
Fri, 10 Jul 2015 19:45:51 +0000 (12:45 -0700)
committerMatt Birkholz <puck@birchwood-abbey.net>
Fri, 10 Jul 2015 19:45:51 +0000 (12:45 -0700)
src/runtime/thread.scm

index 882e002804bd1dda64db7f771d688a3e4bae453d..4f84ba77d7211f4e47f475f851286d2b6d2260c5 100644 (file)
@@ -1085,7 +1085,13 @@ USA.
               (subprocess-registration/thread registration)
               (and event (lambda () (event status))))
              (set-subprocess-registration/status! registration status)))))
-    subprocess-registrations))
+    subprocess-registrations)
+  (set! subprocess-registrations
+       (filter! (lambda (registration)
+                  (let ((status (subprocess-registration/status registration)))
+                    (not (or (eq? status 'EXITED)
+                             (eq? status 'SIGNALLED)))))
+                subprocess-registrations)))
 \f
 ;;;; Timer Events