-
Notifications
You must be signed in to change notification settings - Fork 947
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
Web backend does not handle ControlFlow::Exit nicely #1688
Comments
|
Ah, I saw code that creates a canvas element but didn't realize that the element doesn't get inserted to the DOM. I suppose it also makes sense for the user to clear the canvas at the end. |
I'm giving this a try (likely only for
@ryanisaacg I have some questions for you:
In the current web backend, nothing in the event loop is dropped in any case. |
I don't know how I missed this before, but I just noticed that the current implementation does actually remove the canvas in: winit/src/platform_impl/web/web_sys/canvas.rs Lines 38 to 42 in 83c95e7
The catch is that it only runs when a Window is explicitly dropped, which is why I don't see it happen when the event loop ends.
For the reason you pointed out, this code should be removed, which will be a breaking change. |
Dropping the event handlers should be fine, I don't see any problems that we'll run into there.
I don't think clean-up should be necessary here, because the webpage is going to be cleaned up by the browser anyhow. |
runner::Shared::handle_event
does not properly enforce thatControlFlow::Exit
is sticky. It only checks forself.is_closed()
and does not check the actual user-assignedcontrol
out parameter. (I'm fixing this in a PR, just including this here for completeness.)The text was updated successfully, but these errors were encountered: