Various fixes for cleaning up iframes, compositor layers, pipelines and threads.

This allows most of the jquery test suite to run without exhausting thread resources.
This commit is contained in:
Glenn Watson 2015-04-29 09:13:46 +10:00
parent 5e61ebaa05
commit 2b3737d34e
11 changed files with 191 additions and 14 deletions

View file

@ -431,9 +431,7 @@ impl<Window: WindowMethods> IOCompositor<Window> {
}
(Msg::PaintTaskExited(pipeline_id), ShutdownState::NotShuttingDown) => {
if self.pipeline_details.remove(&pipeline_id).is_none() {
panic!("Saw PaintTaskExited message from an unknown pipeline!");
}
self.remove_pipeline_root_layer(pipeline_id);
}
(Msg::ViewportConstrained(pipeline_id, constraints), ShutdownState::NotShuttingDown) => {
@ -591,6 +589,16 @@ impl<Window: WindowMethods> IOCompositor<Window> {
self.find_layer_with_pipeline_and_layer_id(pipeline_id, LayerId::null())
}
fn remove_pipeline_root_layer(&mut self, pipeline_id: PipelineId) {
if let Some(ref root_layer) = self.scene.root {
// Remove all the compositor layers for this pipeline
// and send any owned buffers back to the paint task.
root_layer.remove_root_layer_with_pipeline_id(self, pipeline_id);
self.pipeline_details.remove(&pipeline_id);
}
}
fn update_layer_if_exists(&mut self, pipeline_id: PipelineId, properties: LayerProperties) -> bool {
match self.find_layer_with_pipeline_and_layer_id(pipeline_id, properties.id) {
Some(existing_layer) => {