-
Notifications
You must be signed in to change notification settings - Fork 34
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
Should [[DisposableResourceStack]] be cleared after dispose? #191
Comments
Hm, that link 404s |
Updated link. |
Good call - seems like |
A stack can only be disposed once, and the value of the internal slot is not observable. So there's no reason to empty it out. |
@bakkot is right. However I have seen implementation leaks like this one over and over. It's not specific to this case, but I'm wondering if we should have an editor note to point out the content of the stack is no longer observable after disposal. |
Makes sense. I'll close this unless you want to repurpose it for adding a note. |
This is a side effect of reusing the same algorithm steps between |
I am considering adding a note like the one in GeneratorStart indicate that the capability will never be reused, but the step in GeneratorStart is predicated on the [[GeneratorState]] slot being set to |
I am considering a note like this
However, I'm wondering if it would be better to actually add a |
In 7.5.8 DisposeResources ( disposeCapability, completion ) it loops through
[[DisposableResourceStack]]
and disposes all of the resources in the stack but I'm not seeing where it might remove those resources or clear the stack. Is there any reason to hold on to them after disposal? If someone is holding on to aDisposableStack
after disposal, wouldn't we also want to prevent them from also having to continue to hold on to all of the now disposed resources?The text was updated successfully, but these errors were encountered: