Description
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
macOS version
ProductName: macOS
ProductVersion: 14.6.1
BuildVersion: 23G93
Winit version
0.30.5
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