Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
scheduler: Do not re-add FD finalisers on FDs that already have one.
Fixes #65. Commit c25dcb9 introduced a memory leak, whereby 'schedule-tasks-for-active-fd' would keep adding fdes finalizers on actively-used file descriptors, for example when calling 'accept' several times on the same file descriptor. This commit fixes it by allowing 'schedule-tasks-for-active-fd' to distinguish between "finalized file descriptor" and "file descriptor without waiters but with a finalizer already". * fibers/scheduler.scm (schedule-tasks-for-active-fd): Set the car of EVENTS+WAITERS to 0, not #f. (schedule-task-when-fd-active): Treat the cases where FD-WAITERS = #f and FD-WAITERS = '(#f) in the same way. In the other case, assume ACTIVE-EVENTS is an integer.
- Loading branch information