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

WireGuard object is not garbage collected #2

Open
thatsed opened this issue Oct 16, 2020 · 0 comments
Open

WireGuard object is not garbage collected #2

thatsed opened this issue Oct 16, 2020 · 0 comments

Comments

@thatsed
Copy link

thatsed commented Oct 16, 2020

Creating a WireGuard instance in a function will keep pipes open, thus preventing garbage collection and filling up file descriptors until they run out and the product throws OSError.

Workaround: declare a single WireGuard object per project, using a wrapper to implement it as singleton (either create a new object or return the same one if it has already been instantiated).

Proposed fix: make the WireGuard class a singleton, or make it so it will be garbage collected.

I can make a PR with the singleton implementation if you'd like.

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

No branches or pull requests

1 participant