Fix wait_events() not stopping when window is closed on X11

This commit is contained in:
Pierre Krieger 2015-04-06 16:47:39 +02:00
parent b5a085343e
commit 80a9e2c316

View file

@ -255,7 +255,7 @@ impl<'a> Iterator for WaitEventsIterator<'a> {
fn next(&mut self) -> Option<Event> {
use std::mem;
loop {
while !self.window.is_closed() {
if let Some(ev) = self.window.pending_events.lock().unwrap().pop_front() {
return Some(ev);
}
@ -270,6 +270,8 @@ impl<'a> Iterator for WaitEventsIterator<'a> {
return Some(ev);
}
}
None
}
}