mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
blockingly shut-down webrender when exiting webgl_thread
This commit is contained in:
parent
581ade575e
commit
59896748b5
40 changed files with 47 additions and 49 deletions
|
@ -333,6 +333,14 @@ impl WebGLThread {
|
|||
Ok(msg) => {
|
||||
let exit = self.handle_msg(msg, &webgl_chan);
|
||||
if exit {
|
||||
// Call remove_context functions in order to correctly delete WebRender image keys.
|
||||
let context_ids: Vec<WebGLContextId> = self.contexts.keys().map(|id| *id).collect();
|
||||
for id in context_ids {
|
||||
self.remove_webgl_context(id);
|
||||
}
|
||||
|
||||
// Block on shutting-down WebRender.
|
||||
self.webrender_api.shut_down(true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -1101,16 +1109,6 @@ impl WebGLThread {
|
|||
}
|
||||
}
|
||||
|
||||
impl Drop for WebGLThread {
|
||||
fn drop(&mut self) {
|
||||
// Call remove_context functions in order to correctly delete WebRender image keys.
|
||||
let context_ids: Vec<WebGLContextId> = self.contexts.keys().map(|id| *id).collect();
|
||||
for id in context_ids {
|
||||
self.remove_webgl_context(id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Helper struct to store cached WebGLContext information.
|
||||
struct WebGLContextInfo {
|
||||
/// Currently used WebRender image key.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue