Fix poll_events() blocking on win32

This commit is contained in:
tomaka 2015-02-11 15:34:08 +01:00
parent 4500702a02
commit d1bf1e8ac0

View file

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