compositor: avoid scheduling rendering on shutdown
authorPekka Paalanen <ppaalanen@gmail.com>
Tue, 3 Jan 2012 08:01:20 +0000 (10:01 +0200)
committerPekka Paalanen <ppaalanen@gmail.com>
Tue, 3 Jan 2012 08:48:54 +0000 (10:48 +0200)
commit0135abee89ccf5403235c869d8e14ecd424d7051
tree0286da51ed64712c2f14fdbc1acdce9d5afa0099
parent9cf5cc882d73b7b5dcd698a2da65869be889439d
compositor: avoid scheduling rendering on shutdown

After the compositor exits the main loop in wl_display_run(), set the
compositor state to SLEEPING. This prevents scheduling repaints, that
will never be executed.

A repaint is scheduled by calling wl_event_loop_add_idle(), which
creates an idle event source. Normally the idle event source object is
destroyed after it has been executed. However, in the shutdown case we
never dispatch events again, and the object is leaked.

This leak is triggered by shell.c destructor, which destroys the
desktop-shell client. Destroying a client ends up calling
wlsc_compositor_schedule_repaint() while destroying the client
resources, especially surfaces.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
compositor/compositor.c