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

Non-static callbacks: What is "service"? #400

Closed
owenthewizard opened this issue Mar 27, 2024 · 2 comments
Closed

Non-static callbacks: What is "service"? #400

owenthewizard opened this issue Mar 27, 2024 · 2 comments

Comments

@owenthewizard
Copy link
Contributor

https://docs.esp-rs.org/esp-idf-svc/esp_idf_svc/wifi/struct.WifiDriver.html#method.set_nonstatic_callbacks

HOWEVER: care should be taken NOT to call core::mem::forget() on the service, as that would immediately lead to an UB (crash). Also note that forgetting the service might happen with Rc and Arc when circular references are introduced: rust-lang/rust#24456

What is the "service" here, the WifiDriver?

@Vollbrecht
Copy link
Collaborator

Yes in all places where we use it, its always the objects that provides this method.

@Vollbrecht
Copy link
Collaborator

In general if you have questions please use the matrix channel linked in the README, so issues can be used for concrete problems

@ivmarkov ivmarkov closed this as completed Apr 1, 2024
@github-project-automation github-project-automation bot moved this from Todo to Done in esp-rs Apr 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

3 participants