I wrote some Rust + Glium code, following along with the examples. Closing the window takes well over a second, and I'm not sure why. Here's the minimal repro code, which strips away any actual graphics calls:
#[macro_use]
extern crate glium;
extern crate image;
use glium::{glutin, Surface};
use glium::index::PrimitiveType;
fn main() {
let mut events_loop = glutin::EventsLoop::new();
let window = glutin::WindowBuilder::new();
let context = glutin::ContextBuilder::new();
let display = glium::Display::new(window, context, &events_loop).unwrap();
let mut closed = false;
while !closed {
events_loop.poll_events(|event| {
match event {
glutin::Event::WindowEvent { event, .. } => match event {
glutin::WindowEvent::CloseRequested => {
closed = true;
println!("Close");
},
_ => ()
},
_ => (),
}
});
}
}
There's a big delay between the "Close" print, and the window actually closing. Any ideas on how I can eliminate this slowdown? The slowdown prominently exists in release mode too.