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.
This commit is contained in:
Martin Robinson 2015-10-07 12:11:54 -07:00
parent 1d617f332e
commit dae22b6e80
6 changed files with 47 additions and 69 deletions

View file

@ -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
}