Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix leak from fs_scandir whenever it wasn't fully iterated via fs_scandir_next #601

Merged
merged 1 commit into from
May 31, 2022

Conversation

squeek502
Copy link
Member

@squeek502 squeek502 commented May 31, 2022

Now, we have a specialized metatable ("uv_fs") with a gc function that's only used for scandir's uv_fs_t reqs, so that it will always be cleaned up automatically. This also means that once fully iterated, the req is no longer immediately cleaned up and so any subsequent calls to fs_scandir_next will just return nil (whereas previously it would have errored in the luv_check_fs function).

Closes #600

…scandir_next`

Now, we have a specialized metatable ("uv_fs") with a gc function that's only used for scandir's uv_fs_t reqs, so that it will always be cleaned up automatically. This also means that once fully iterated, the req is no longer immediately cleaned up and so any subsequent calls to `fs_scandir_next` will just return `nil` (whereas previously it would have errored out in `luv_check_fs`).

Closes luvit#600
@squeek502 squeek502 merged commit 02d703b into luvit:master May 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

fs_scandir iterator causes memory leak with early break
2 participants