Commit 44b529f2 authored by Kristian Høgsberg's avatar Kristian Høgsberg
Browse files

server: Allocate server ID for when resource->object.id is 0

parent c7473897
......@@ -322,9 +322,16 @@ WL_EXPORT void
wl_client_add_resource(struct wl_client *client,
struct wl_resource *resource)
{
if (resource->object.id == 0)
resource->object.id =
wl_map_insert_new(&client->objects,
WL_MAP_SERVER_SIDE, resource);
else
wl_map_insert_at(&client->objects,
resource->object.id, resource);
resource->client = client;
wl_list_init(&resource->destroy_listener_list);
wl_map_insert_at(&client->objects, resource->object.id, resource);
}
WL_EXPORT void
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment