We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When the I exit the event loop, a tracing error is given.
Code that caused the error:
use winit::application::ApplicationHandler; use winit::event::WindowEvent; use winit::event_loop::{ActiveEventLoop, EventLoop}; use winit::window::{Window, WindowAttributes, WindowId}; fn main() { tracing_subscriber::fmt::init(); let mut app = App { window: None }; let event_loop = EventLoop::new().unwrap(); event_loop.run_app(&mut app).unwrap(); } struct App { window: Option<Window> } impl ApplicationHandler for App { fn resumed(&mut self, event_loop: &ActiveEventLoop) { self.window = Some(event_loop.create_window(WindowAttributes::default()).unwrap()); } fn window_event(&mut self, event_loop: &ActiveEventLoop, _window_id: WindowId, event: WindowEvent) { match event { WindowEvent::CloseRequested => event_loop.exit(), _ => () } } }
The error:
2024-09-11T22:44:09.138281Z ERROR winit::platform_impl::macos::event_handler: tried to run event handler, but no handler was set
ProductName: macOS ProductVersion: 14.6.1 BuildVersion: 23G93
0.30.5
The text was updated successfully, but these errors were encountered:
I suspect this is due to the window being dropped after the application has exited, and I think it will be fixed by #3895.
In the meantime, try doing self.window = None inside CloseRequested?
self.window = None
CloseRequested
Sorry, something went wrong.
Thanks, that fixes it.
No branches or pull requests
Description
When the I exit the event loop, a tracing error is given.
Code that caused the error:
The error:
macOS version
Winit version
0.30.5
The text was updated successfully, but these errors were encountered: