[PATCH] wayland-server: fix resource destroy
Fiedler, Mathias
Mathias.Fiedler at xse.de
Fri Oct 7 00:49:48 PDT 2011
Hi,
object id was read from freed memory.
In rare cases i got errors where compositor was complaining about wrong or still used object ids.
diff --git a/wayland/src/wayland-server.c b/wayland/src/wayland-server.c
index a6cd88d..5eb7906 100644
--- a/wayland/src/wayland-server.c
+++ b/wayland/src/wayland-server.c
@@ -313,9 +313,9 @@ WL_EXPORT void
wl_resource_destroy(struct wl_resource *resource, uint32_t time)
{
struct wl_client *client = resource->client;
-
+ uint32_t id = resource->object.id;
destroy_resource(resource, &time);
- wl_map_insert_at(&client->objects, resource->object.id, NULL);
+ wl_map_insert_at(&client->objects, id, NULL);
}
WL_EXPORT void
More information about the wayland-devel
mailing list