aboutsummaryrefslogtreecommitdiffstats
path: root/components/script_traits/lib.rs
diff options
context:
space:
mode:
authorJosh Matthews <josh@joshmatthews.net>2020-06-09 15:52:03 -0400
committerJosh Matthews <josh@joshmatthews.net>2020-06-09 15:52:03 -0400
commit125bfceafd4dac829604b7a3e9f50694df00a41d (patch)
treeb2bea12e09ebf751e14ecf17de83632d3dc4865b /components/script_traits/lib.rs
parentc88bea8d931bae39323d0ad023eaf547d50c67bb (diff)
downloadservo-125bfceafd4dac829604b7a3e9f50694df00a41d.tar.gz
servo-125bfceafd4dac829604b7a3e9f50694df00a41d.zip
script: Don't panic when IPC WebRender APIs fail during shutdown.
Diffstat (limited to 'components/script_traits/lib.rs')
-rw-r--r--components/script_traits/lib.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/components/script_traits/lib.rs b/components/script_traits/lib.rs
index 4403627bca4..b3e92cbce21 100644
--- a/components/script_traits/lib.rs
+++ b/components/script_traits/lib.rs
@@ -1195,12 +1195,12 @@ impl WebrenderIpcSender {
}
/// Create a new image key. Blocks until the key is available.
- pub fn generate_image_key(&self) -> ImageKey {
+ pub fn generate_image_key(&self) -> Result<ImageKey, ()> {
let (sender, receiver) = ipc::channel().unwrap();
self.0
.send(WebrenderMsg::GenerateImageKey(sender))
- .expect("error sending image key generation");
- receiver.recv().expect("error receiving image key result")
+ .map_err(|_| ())?;
+ receiver.recv().map_err(|_| ())
}
/// Perform a resource update operation.