Auto merge of #14762 - prampey:error-handle, r=jdm

Error handled canvas closing

<!-- Please describe your changes on the following line: -->
Correctly handled error when Canvas doesn't close properly, with a descriptive warning.

---
<!-- 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 #14002  (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because minor changes don't require tests.

<!-- 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/14762)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2016-12-28 13:49:02 -08:00 committed by GitHub
commit c6ea1ec91f

View file

@ -1319,7 +1319,9 @@ impl CanvasRenderingContext2DMethods for CanvasRenderingContext2D {
impl Drop for CanvasRenderingContext2D {
fn drop(&mut self) {
self.ipc_renderer.send(CanvasMsg::Common(CanvasCommonMsg::Close)).unwrap();
if let Err(err) = self.ipc_renderer.send(CanvasMsg::Common(CanvasCommonMsg::Close)) {
warn!("Could not close canvas: {}", err)
}
}
}