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

Releasing owned resources on Generator drop #57

Open
cstorey opened this issue Oct 24, 2016 · 1 comment
Open

Releasing owned resources on Generator drop #57

cstorey opened this issue Oct 24, 2016 · 1 comment

Comments

@cstorey
Copy link

cstorey commented Oct 24, 2016

I notice that there's no Drop implementation for Generator, and so it looks like it's owned stack won't get unwound, and so any resources owned by a Generator's stack will get leaked.

So, it seems that that the only way currently to forcefully unwind a generator's stack is to pass in a value that asks it to panic, such as in this example. Is that right?

I notice that context-rs has the ability to spawn a function on top of a recovered stack, which might be an option for future implementation. But that seems quite risky.

@Amanieu
Copy link
Collaborator

Amanieu commented Oct 24, 2016

See #52

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

2 participants