xwm: Fix a weston crash when a window surface is created after unmap
authorDerek Foreman <derekf@osg.samsung.com>
Thu, 9 Apr 2015 19:48:22 +0000 (14:48 -0500)
committerPekka Paalanen <pekka.paalanen@collabora.co.uk>
Fri, 10 Apr 2015 07:00:59 +0000 (10:00 +0300)
commit9a0b2b54e2242af0371c98e00e1d3ea0a70064a1
tree39b3517ac004169511c83467abd9bddf66d029cc
parent90f23ca3f46f8721496ee5d7b73c24a2f17dd4f5
xwm: Fix a weston crash when a window surface is created after unmap

If windows are created and quickly destroyed it's possible that they'll be
on the unpaired window list at the time of surface creation.  The surface
destroy listener for that surface isn't properly freed and a crash happens
some time later.

This patch removes the window from the unpaired list during unmap, so we
should never get to the destroy handler with a surface destroy listener set.

Just in case there's another path to that failure, I've also removed the
surface destroy listener in the destory handler.

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Acked-by: Jasper St. Pierre <jstpierre@mecheye.net>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
xwayland/window-manager.c