mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2025-11-04 13:29:51 -05:00
wayland-server: Destroy resource before sending out delete_id event
In some cases, we send out events from the resource destructor and those need to go out before we recycle the object ID.
This commit is contained in:
parent
e7f6c509e2
commit
0d22d25b87
1 changed files with 8 additions and 7 deletions
|
|
@ -393,19 +393,20 @@ WL_EXPORT void
|
||||||
wl_resource_destroy(struct wl_resource *resource, uint32_t time)
|
wl_resource_destroy(struct wl_resource *resource, uint32_t time)
|
||||||
{
|
{
|
||||||
struct wl_client *client = resource->client;
|
struct wl_client *client = resource->client;
|
||||||
|
uint32_t id;
|
||||||
|
|
||||||
if (resource->object.id < WL_SERVER_ID_START) {
|
id = resource->object.id;
|
||||||
|
destroy_resource(resource, &time);
|
||||||
|
|
||||||
|
if (id < WL_SERVER_ID_START) {
|
||||||
if (client->display_resource) {
|
if (client->display_resource) {
|
||||||
wl_resource_queue_event(client->display_resource,
|
wl_resource_queue_event(client->display_resource,
|
||||||
WL_DISPLAY_DELETE_ID,
|
WL_DISPLAY_DELETE_ID, id);
|
||||||
resource->object.id);
|
|
||||||
}
|
}
|
||||||
wl_map_insert_at(&client->objects, resource->object.id, NULL);
|
wl_map_insert_at(&client->objects, id, NULL);
|
||||||
} else {
|
} else {
|
||||||
wl_map_remove(&client->objects, resource->object.id);
|
wl_map_remove(&client->objects, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
destroy_resource(resource, &time);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
WL_EXPORT void
|
WL_EXPORT void
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue