diff options
Diffstat (limited to 'components/layout/layout_task.rs')
-rw-r--r-- | components/layout/layout_task.rs | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/components/layout/layout_task.rs b/components/layout/layout_task.rs index 046d79b1805..e55805486b3 100644 --- a/components/layout/layout_task.rs +++ b/components/layout/layout_task.rs @@ -126,6 +126,9 @@ pub struct LayoutTask { //// The channel to send messages to ourself. pub chan: LayoutChan, + /// The channel on which messages can be sent to the constellation. + pub constellation_chan: ConstellationChan, + /// The channel on which messages can be sent to the script task. pub script_chan: ScriptControlChan, @@ -274,6 +277,7 @@ impl LayoutTask { pipeline_port: pipeline_port, chan: chan, script_chan: script_chan, + constellation_chan: constellation_chan.clone(), paint_chan: paint_chan, time_profiler_chan: time_profiler_chan, resource_task: resource_task, @@ -414,7 +418,7 @@ impl LayoutTask { }, Msg::ReapLayoutData(dead_layout_data) => { unsafe { - LayoutTask::handle_reap_layout_data(dead_layout_data) + self.handle_reap_layout_data(dead_layout_data) } }, Msg::PrepareToExit(response_chan) => { @@ -443,7 +447,7 @@ impl LayoutTask { match self.port.recv().unwrap() { Msg::ReapLayoutData(dead_layout_data) => { unsafe { - LayoutTask::handle_reap_layout_data(dead_layout_data) + self.handle_reap_layout_data(dead_layout_data) } } Msg::ExitNow(exit_type) => { @@ -940,9 +944,9 @@ impl LayoutTask { /// Handles a message to destroy layout data. Layout data must be destroyed on *this* task /// because the struct type is transmuted to a different type on the script side. - unsafe fn handle_reap_layout_data(layout_data: LayoutData) { + unsafe fn handle_reap_layout_data(&self, layout_data: LayoutData) { let layout_data_wrapper: LayoutDataWrapper = mem::transmute(layout_data); - layout_data_wrapper.clear(); + layout_data_wrapper.remove_compositor_layers(self.constellation_chan.clone()); } /// Returns profiling information which is passed to the time profiler. |