-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Weak values keep whole dictionary alive? #9028
Comments
the lambda will be destroyed after the finalizer is run, allowing the dictionary to be freed. in what situation do you foresee this being dangerous? |
I am thinking of a case where the dictionary can be garbage collected, but -erik On Sunday, November 16, 2014, Jameson Nash notifications@github.com wrote:
Erik Schnetter schnetter@gmail.com |
Maybe we should go with the plan described by the TODO in We could also consider adding this behavior to Also, |
I think this can be closed as the problematic method |
While browsing dict.jl, I've come across this function:
This looks as if the lambda passed to the finalizer keeps the whole dictionary (
t
) alive. This sounds dangerous if dictionaries with weak keys are transient (which may not be the "usual" way they are used).The text was updated successfully, but these errors were encountered: