diff options
author | Martin Robinson <mrobinson@igalia.com> | 2015-10-07 12:11:54 -0700 |
---|---|---|
committer | Martin Robinson <mrobinson@igalia.com> | 2015-10-07 18:42:11 -0700 |
commit | dae22b6e80914abd1ce749d89b0a3d86c38af668 (patch) | |
tree | 4f8a2e6b0b44d68cb27d2aaf206aa6d43db3b3d8 /components/compositing/headless.rs | |
parent | 1d617f332edd0036ca4cbc3890f1f44f57597906 (diff) | |
download | servo-dae22b6e80914abd1ce749d89b0a3d86c38af668.tar.gz servo-dae22b6e80914abd1ce749d89b0a3d86c38af668.zip |
Simplify and unify compositor shutdown code paths
Unify all compositor shutdown code paths into two methods, one which
starts the shutdown and the other that finishes it. This simplifies the
way the compositor shuts down and prevents "leaking" pixmaps when
exiting in uncommon ways.
Diffstat (limited to 'components/compositing/headless.rs')
-rw-r--r-- | components/compositing/headless.rs | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/components/compositing/headless.rs b/components/compositing/headless.rs index 41bcc3811d2..d322ef77445 100644 --- a/components/compositing/headless.rs +++ b/components/compositing/headless.rs @@ -69,6 +69,14 @@ impl CompositorEventListener for NullCompositor { Msg::ShutdownComplete => { debug!("constellation completed shutdown"); + + // Drain compositor port, sometimes messages contain channels that are blocking + // another task from finishing (i.e. SetIds) + while self.port.try_recv_compositor_msg().is_some() {} + + self.time_profiler_chan.send(time::ProfilerMsg::Exit); + self.mem_profiler_chan.send(mem::ProfilerMsg::Exit); + return false } @@ -130,15 +138,6 @@ impl CompositorEventListener for NullCompositor { fn repaint_synchronously(&mut self) {} - fn shutdown(&mut self) { - // Drain compositor port, sometimes messages contain channels that are blocking - // another task from finishing (i.e. SetIds) - while self.port.try_recv_compositor_msg().is_some() {} - - self.time_profiler_chan.send(time::ProfilerMsg::Exit); - self.mem_profiler_chan.send(mem::ProfilerMsg::Exit); - } - fn pinch_zoom_level(&self) -> f32 { 1.0 } |