~ chicken-core (chicken-5) 673af0484ac657225b37fe1c4580fc163c646d22


commit 673af0484ac657225b37fe1c4580fc163c646d22
Author:     Peter Bex <peter@more-magic.net>
AuthorDate: Thu Feb 6 11:01:57 2025 +0100
Commit:     Peter Bex <peter@more-magic.net>
CommitDate: Thu Feb 6 11:01:57 2025 +0100

    Always drop the reaped child from the list of children
    
    The memory leak mentioned in the aforementioned commit is still there
    if we explicitly pass in a process object: when forking, the process
    is registered, but we'd never unregister it.

diff --git a/posix-common.scm b/posix-common.scm
index c888a108..237fd272 100644
--- a/posix-common.scm
+++ b/posix-common.scm
@@ -732,8 +732,8 @@ EOF
                 (unless (process? proc)
                   (let ((a (assq epid children)))
                     (when a
-                      (set! proc (cdr a))
-                      (drop-child epid))))
+                      (set! proc (cdr a)))))
+                (drop-child epid)
                 (when (process? proc)
                   (process-returned-normally?-set! proc enorm)
                   (process-exit-status-set! proc ecode))
Trap