servo: Merge #2646 - Don't fail on clearing nonexistant timeouts (from Manishearth:cleartimeout-opt); r=jdm
authorManish Goregaokar <manishsmail@gmail.com>
Fri, 13 Jun 2014 08:10:57 -0400
changeset 334519 149d2b0cac97a5d19f7d678d8b8a66b6aad9dd7a
parent 334518 e8d2694bbcfb228500a4e4258b621043494ba448
child 334520 34e7e8a2f5d87f6bbdf5d3cc6262594d45204351
push id31307
push usergszorc@mozilla.com
push dateSat, 04 Feb 2017 00:59:06 +0000
treeherdermozilla-central@94079d43835f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjdm
servo: Merge #2646 - Don't fail on clearing nonexistant timeouts (from Manishearth:cleartimeout-opt); r=jdm Source-Repo: https://github.com/servo/servo Source-Revision: 58b776e0b559cd08db9ecb44dd0b1bbea731af57
servo/src/components/script/dom/window.rs
--- a/servo/src/components/script/dom/window.rs
+++ b/servo/src/components/script/dom/window.rs
@@ -56,17 +56,17 @@ impl Hash for TimerId {
     fn hash(&self, state: &mut sip::SipState) {
         let TimerId(id) = *self;
         id.hash(state);
     }
 }
 
 impl TimerHandle {
     fn cancel(&mut self) {
-        self.cancel_chan.as_ref().map(|chan| chan.send(()));
+        self.cancel_chan.as_ref().map(|chan| chan.send_opt(()).ok());
     }
 }
 
 #[deriving(Encodable)]
 pub struct Window {
     pub eventtarget: EventTarget,
     pub script_chan: ScriptChan,
     pub console: Cell<Option<JS<Console>>>,