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 fd memory leak on Linux #265

Merged
merged 1 commit into from
Dec 4, 2022
Merged

Conversation

zear
Copy link
Collaborator

@zear zear commented Dec 4, 2022

The Linux implementation of OS_fopen fails to close directories after use, leaking the underlying file descriptors. Eventually, the limit of allowed file descriptors per process is reached, causing subsequent opendir failures, and leading to random game crashes.

Fix this issue by calling closedir once the directory can be disposed.

This fixes #264.

The Linux implementation of `OS_fopen` fails to close directories after
use, leaking the underlying file descriptors. Eventually, the limit of
allowed file descriptors per process is reached, causing subsequent
`opendir` failures, and leading to random game crashes.

Fix this issue by calling `closedir` once the directory can be disposed.

Signed-off-by: Artur Rojek <contact@artur-rojek.eu>
@madebr madebr merged commit 0343e53 into dethrace-labs:main Dec 4, 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.

File descriptor leaks on Linux
2 participants