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

Question about gloo_timers::callback::Timeout #492

Open
pg-wtatum opened this issue Aug 28, 2024 · 0 comments
Open

Question about gloo_timers::callback::Timeout #492

pg-wtatum opened this issue Aug 28, 2024 · 0 comments

Comments

@pg-wtatum
Copy link

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?

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

1 participant