Skip to content

Question about gloo_timers::callback::Timeout #492

@pg-wtatum

Description

@pg-wtatum

The example shown at https://docs.rs/gloo-timers/0.3.0/gloo_timers/#timeouts-with-a-callback-function indicates it's okay to forget a timeout if you don't intend to cancel it. I see that Timeout uses Closure::once. Docs on Closure::once indicate that it enforces at runtime that it is only called on time but I didn't see anything indicating if resources associated to the closure are automatically cleaned up (as opposed to being leaked) after it has run.

Will repeatedly calling Timeout::new(...).forget() leak resources?

Metadata

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