servo: Merge #2252 - Make ContainerLayer::first_child borrow temporary (from mbrubeck:1778-borrow-layer); r=larsbergstrom

Fixes a crash in ContainerLayer::remove_child (#1778). r? @larsbergstrom

Source-Repo: https://github.com/servo/servo
Source-Revision: afae6a3c71a722258e204ba51551a2a6143920d5
This commit is contained in:
Matt Brubeck 2014-04-28 18:07:38 -04:00
parent 4c28ea9b9e
commit 0ba8cd6356

View File

@ -376,10 +376,11 @@ impl IOCompositor {
self.opts.tile_size,
self.opts.cpu_painting);
match *self.root_layer.first_child.borrow() {
let first_child = self.root_layer.first_child.borrow().clone();
match first_child {
None => {}
Some(ref old_layer) => {
ContainerLayer::remove_child(self.root_layer.clone(), old_layer.clone())
Some(old_layer) => {
ContainerLayer::remove_child(self.root_layer.clone(), old_layer)
}
}