Merge pull request #269 from tomaka/tomaka-patch-2

Fix poll_events() blocking on win32
This commit is contained in:
tomaka 2015-02-11 15:39:14 +01:00
commit de56a569e8

View file

@ -270,7 +270,7 @@ impl<'a> Iterator for PollEventsIterator<'a> {
fn next(&mut self) -> Option<Event> { fn next(&mut self) -> Option<Event> {
use events::Event::Closed; use events::Event::Closed;
match self.window.events_receiver.recv() { match self.window.events_receiver.try_recv() {
Ok(Closed) => { Ok(Closed) => {
use std::sync::atomic::Ordering::Relaxed; use std::sync::atomic::Ordering::Relaxed;
self.window.is_closed.store(true, Relaxed); self.window.is_closed.store(true, Relaxed);