mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Auto merge of #22040 - paulrouget:shutdown_canvas_paint_thread, r=jdm
Exit Canvas paint thread on shutdown <!-- Please describe your changes on the following line: --> --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #22038 (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. --> <!-- 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/22040) <!-- Reviewable:end -->
This commit is contained in:
commit
cbd81d2ad9
3 changed files with 7 additions and 0 deletions
|
@ -66,6 +66,7 @@ impl<'a> CanvasPaintThread <'a> {
|
|||
}
|
||||
}
|
||||
},
|
||||
CanvasMsg::Exit => break,
|
||||
}
|
||||
},
|
||||
Err(e) => {
|
||||
|
|
|
@ -27,6 +27,7 @@ pub enum CanvasMsg {
|
|||
FromScript(FromScriptMsg, CanvasId),
|
||||
Recreate(Size2D<u32>, CanvasId),
|
||||
Close(CanvasId),
|
||||
Exit,
|
||||
}
|
||||
|
||||
#[derive(Clone, Deserialize, Serialize)]
|
||||
|
|
|
@ -1441,6 +1441,11 @@ where
|
|||
}
|
||||
}
|
||||
|
||||
debug!("Exiting Canvas Paint thread.");
|
||||
if let Err(e) = self.canvas_chan.send(CanvasMsg::Exit) {
|
||||
warn!("Exit Canvas Paint thread failed ({})", e);
|
||||
}
|
||||
|
||||
if let Some(webgl_threads) = self.webgl_threads.as_ref() {
|
||||
debug!("Exiting WebGL thread.");
|
||||
if let Err(e) = webgl_threads.exit() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue