Skip to content

Releasing owned resources on Generator drop #57

Open
@cstorey

Description

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.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions