Drop webgl main thread data during shutdown.

This commit is contained in:
Josh Matthews 2019-07-29 08:15:59 -04:00 committed by GitHub
parent 447ae1eae6
commit 25b20ebfc6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -112,12 +112,14 @@ impl WebGLMainThread {
// Any context could be current when we start.
self.thread_data.borrow_mut().bound_context_id = None;
self.shut_down.set(
!self
.thread_data
.borrow_mut()
.process(EventLoop::Nonblocking),
);
let result = self
.thread_data
.borrow_mut()
.process(EventLoop::Nonblocking);
if !result {
self.shut_down.set(true);
WEBGL_MAIN_THREAD.with(|thread_data| thread_data.borrow_mut().take());
}
}
/// Returns the main GL thread if called from the main thread,