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

dispose of previous inner (in-memory) cache when calling ClearAll() #49

Merged
merged 1 commit into from
Jul 26, 2021

Conversation

ybqwerty
Copy link
Collaborator

This fixes a memory leak happens upon calling ClearAll() on InMemoryCache instances.

I had a concern that some classes will hold the reference of the previous cache and that the disposing will cause in certain edge race cases a serious exception (AlreadyDisposedException).
But using the dispose cache object is ok, but does nothing and no exception as well.
Set: will not set, as if the ClearAll was called a nanosecond after setting
Get: will get nothing, as if the ClearAll was called a nanosecond before getting

@ybqwerty ybqwerty requested a review from amitla July 25, 2021 16:27
@ybqwerty ybqwerty merged commit 593bd18 into master Jul 26, 2021
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.

2 participants