aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2019-07-29 11:48:54 -0400
committerGitHub <noreply@github.com>2019-07-29 11:48:54 -0400
commit7a570a7322917f2a9d12d0fce04ef6048b94f4ee (patch)
tree059dc3bbfa07987c4bd4bf9e4ec97a63b332a919
parent447ae1eae6e21017d2afd8d6b17a9f8ab889dd3f (diff)
parent25b20ebfc650013140fce9e8943e4405d77de1a6 (diff)
downloadservo-7a570a7322917f2a9d12d0fce04ef6048b94f4ee.tar.gz
servo-7a570a7322917f2a9d12d0fce04ef6048b94f4ee.zip
Auto merge of #23883 - servo:jdm-patch-45, r=asajeffrey
Drop webgl main thread data during shutdown. Before this change I get a panic late in shutdown because we end up trying to communicate with webrender during TLS teardown. --- - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes do not require tests because no tests on windows. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23883) <!-- Reviewable:end -->
-rw-r--r--components/canvas/webgl_thread.rs14
1 files changed, 8 insertions, 6 deletions
diff --git a/components/canvas/webgl_thread.rs b/components/canvas/webgl_thread.rs
index f2099094127..faea8e76d1c 100644
--- a/components/canvas/webgl_thread.rs
+++ b/components/canvas/webgl_thread.rs
@@ -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,