Free non-legacy resources inside wl_resource_destroy
authorJason Ekstrand <jason@jlekstrand.net>
Tue, 18 Jun 2013 17:42:40 +0000 (12:42 -0500)
committerKristian Høgsberg <krh@bitplanet.net>
Thu, 20 Jun 2013 19:12:26 +0000 (15:12 -0400)
commit96afa347762bd9796288e8052ccc42989a68386d
tree931e054ac8b9cc8da491d08999b4436d3079d0b5
parent7094441b1d1ad15e7e0121410d23c3e94731a805
Free non-legacy resources inside wl_resource_destroy

This commit makes wl_resource_destroy automatically free all non-legacy
resource structures.  Since wl_resource is now an opaque structure it
doesn't make sense for the clients to be freeing it.  This checks to make
sure that it was added through wl_client_add_object or wl_client_new_object
and not wl_client_add_resource before it frees it.  This way if it is a
legacy resources embedded in a structure somewhere we don't have an invalid
free.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
src/wayland-server.c