diff options
author | Pierre Krieger <pierre.krieger1708@gmail.com> | 2015-04-06 16:47:39 +0200 |
---|---|---|
committer | Pierre Krieger <pierre.krieger1708@gmail.com> | 2015-04-06 16:47:39 +0200 |
commit | 80a9e2c316d81908c5992541331010d3f0a64f47 (patch) | |
tree | d9f4ba2b77fae409c683dc58848dfcd1c023a81c /src/x11 | |
parent | b5a085343ef88e26624a76a75ae59c1c3d828cf5 (diff) | |
download | glutin-80a9e2c316d81908c5992541331010d3f0a64f47.tar.gz glutin-80a9e2c316d81908c5992541331010d3f0a64f47.zip |
Fix wait_events() not stopping when window is closed on X11
Diffstat (limited to 'src/x11')
-rw-r--r-- | src/x11/window/mod.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/x11/window/mod.rs b/src/x11/window/mod.rs index 3820bd4..7121ac6 100644 --- a/src/x11/window/mod.rs +++ b/src/x11/window/mod.rs @@ -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 } } |