aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/script_thread.rs
diff options
context:
space:
mode:
authorJosh Matthews <josh@joshmatthews.net>2016-12-22 16:56:25 -0500
committerJosh Matthews <josh@joshmatthews.net>2016-12-22 18:56:06 -0500
commit8ca387c0e067a723ca649ded958879e66535f66c (patch)
treebb28e6d824069ef444c948c81e3966a52b32a21e /components/script/script_thread.rs
parentd918c1424783dedb8bb7f9dcbba00b8fcc0b0254 (diff)
downloadservo-8ca387c0e067a723ca649ded958879e66535f66c.tar.gz
servo-8ca387c0e067a723ca649ded958879e66535f66c.zip
Warn when a timer event is processed for a discarded document.
Diffstat (limited to 'components/script/script_thread.rs')
-rw-r--r--components/script/script_thread.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/components/script/script_thread.rs b/components/script/script_thread.rs
index c2d8deec622..538ce0b5f8c 100644
--- a/components/script/script_thread.rs
+++ b/components/script/script_thread.rs
@@ -1049,8 +1049,11 @@ impl ScriptThread {
TimerSource::FromWorker => panic!("Worker timeouts must not be sent to script thread"),
};
- let window = self.documents.borrow().find_window(pipeline_id)
- .expect("ScriptThread: received fire timer msg for a pipeline not in this script thread. This is a bug.");
+ let window = self.documents.borrow().find_window(pipeline_id);
+ let window = match window {
+ Some(w) => w,
+ None => return warn!("Received fire timer msg for a closed pipeline {}.", pipeline_id),
+ };
window.handle_fire_timer(id);
}