Skip to content

Oneshot should hold the inner #222

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

Merged
merged 1 commit into from
May 19, 2022

Conversation

dianqk
Copy link
Contributor

@dianqk dianqk commented May 19, 2022

When using other Executors for poll tasks, such as wasm-bindgen-futures (yes, I removed the web-related ones and just kept the task and queue).
wake and poll are separate calls, and when the host calls the send method of Sender of wit-bindgen-rust, Sender will be released and the inner instance will be released at the same time, which will cause OneShot to not get the inner instance.

When using other Executors for poll tasks, such as `wasm-bindgen-futures` (yes, I removed the web-related ones and just kept the task and queue).
wake and poll are separate calls, and when the host calls `sender` of `wit-bindgen-rust`'s When the host calls the `send` method of `Sender` of `wit-bindgen-rust`, `Sender` will be released and the inner instance will be released at the same time, which will cause `OneShot` to not get the `inner` instance.
@alexcrichton
Copy link
Member

Oops indeed, thanks!

@alexcrichton alexcrichton merged commit a79a4be into bytecodealliance:main May 19, 2022
willemneal pushed a commit to AhaLabs/wit-bindgen that referenced this pull request May 31, 2022
When using other Executors for poll tasks, such as `wasm-bindgen-futures` (yes, I removed the web-related ones and just kept the task and queue).
wake and poll are separate calls, and when the host calls `sender` of `wit-bindgen-rust`'s When the host calls the `send` method of `Sender` of `wit-bindgen-rust`, `Sender` will be released and the inner instance will be released at the same time, which will cause `OneShot` to not get the `inner` instance.
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

Successfully merging this pull request may close these issues.

2 participants