mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Auto merge of #26922 - gterzian:shutdown_webrender, r=jdm
Blockingly shut-down webrender api <!-- Please describe your changes on the following line: --> FIX https://github.com/servo/servo/issues/26876 --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [ ] `./mach build -d` does not report any errors - [ ] `./mach test-tidy` does not report any errors - [ ] These changes fix #___ (GitHub issue number if applicable) <!-- Either: --> - [ ] There are tests for these changes OR - [ ] These changes do not require tests because ___ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
This commit is contained in:
commit
d9b2cf53e8
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