mirror of
https://github.com/rust-windowing/winit.git
synced 2026-08-29 04:40:04 -04:00
winit-web: return immediately from run_app on web
This avoids using JavaScript exceptions to support `EventLoop::run_app` on the web, which is a huge hack, and doesn't work with the Exception Handling Proposal for WebAssembly: https://github.com/WebAssembly/exception-handling This needs the application handler passed to `run_app` to be `'static`, but that works better on iOS too anyhow (since you can't accidentally forget to pass in state that then wouldn't be dropped when terminating).
This commit is contained in:
committed by
Kirill Chibisov
parent
165c163f01
commit
c98d880a1c
@@ -56,8 +56,7 @@ impl ActiveEventLoop {
|
||||
Self { runner: runner::Shared::new(), modifiers: ModifiersShared::default() }
|
||||
}
|
||||
|
||||
pub(crate) fn run(&self, app: Box<dyn ApplicationHandler>, event_loop_recreation: bool) {
|
||||
self.runner.event_loop_recreation(event_loop_recreation);
|
||||
pub(crate) fn run(&self, app: Box<dyn ApplicationHandler>) {
|
||||
self.runner.start(app, self.clone());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user