compositor: Fix crash when surface is map'd and unmap'd before repaint
authorAnder Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Fri, 15 Jun 2012 14:27:34 +0000 (17:27 +0300)
committerKristian Høgsberg <krh@bitplanet.net>
Fri, 15 Jun 2012 14:55:08 +0000 (10:55 -0400)
commit912f20b9b7cfbb39b4ebe72b2c8f2dcad8b57570
tree8de3301fcb744d8a10fd2d382619ff59bb2f9e18
parent319b29c954fcd2fb38d8f9627a6d3c30e9d73d14
compositor: Fix crash when surface is map'd and unmap'd before repaint

If a surface is map'd and unmap'd before an output repaint occurs, it
is not added to the compositor's surface list, so the field
weston_surface::link might be invalid (the field is initialized on
weston_surface_create()), and it that case Weston will crash on the
call to wl_list_remove(&surface->link) in weston_surface_unmap().

Initialize the surface->link after the call to wl_list_remove() to make
sure a following call to wl_list_remove() won't cause a crash.
src/compositor.c