auto merge of #5040 : Ms2ger/servo/cleanup-unroot, r=jdm

This commit is contained in:
bors-servo 2015-02-23 14:51:54 -07:00
commit 9a5970ccea

View file

@ -634,11 +634,9 @@ impl RootCollection {
fn unroot<'b, T: Reflectable>(&self, rooted: &Root<T>) {
unsafe {
let roots = self.roots.get();
debug!("unrooting {:?} (expecting {:?}",
(*roots).as_slice().last().unwrap(),
rooted.js_ptr);
assert!(*(*roots).as_slice().last().unwrap() == rooted.js_ptr);
(*roots).pop().unwrap();
let unrooted = (*roots).pop().unwrap();
debug!("unrooted {:?} (expecting {:?}", unrooted, rooted.js_ptr);
assert!(unrooted == rooted.js_ptr);
}
}
}