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 potential memory leak #25

Merged
merged 1 commit into from
Oct 10, 2023
Merged

Fix potential memory leak #25

merged 1 commit into from
Oct 10, 2023

Conversation

meksor
Copy link
Contributor

@meksor meksor commented Oct 10, 2023

Fixes a potential memory leak in the ManagerConfig class.
Since the lru_cache decorator is used in the class body the wrapped function and its cache persists across class instances and will not be garbage collected upon deletion of the class instance.
This PR fixes that by moving the cache construction to the classes __init__ method.

Copy link
Member

@glatterf42 glatterf42 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me :)

@meksor meksor merged commit 6a95fd0 into main Oct 10, 2023
4 checks passed
@glatterf42 glatterf42 deleted the bugfix/lru_cache-leak branch October 10, 2023 12:07
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.

None yet

2 participants