mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2025-10-29 05:40:16 -04:00
wayland-server: Free non-legacy wl_resource structs during wl_client_destroy
We need to free the non-legacy resources during client shutdown as well.
This commit is contained in:
parent
477c7237e1
commit
3cff4693ea
1 changed files with 6 additions and 3 deletions
|
|
@ -422,11 +422,17 @@ static void
|
|||
destroy_resource(void *element, void *data)
|
||||
{
|
||||
struct wl_resource *resource = element;
|
||||
struct wl_client *client = resource->client;
|
||||
uint32_t flags;
|
||||
|
||||
wl_signal_emit(&resource->destroy_signal, resource);
|
||||
|
||||
flags = wl_map_lookup_flags(&client->objects, resource->object.id);
|
||||
if (resource->destroy)
|
||||
resource->destroy(resource);
|
||||
|
||||
if (!(flags & WL_MAP_ENTRY_LEGACY))
|
||||
free(resource);
|
||||
}
|
||||
|
||||
WL_EXPORT void
|
||||
|
|
@ -438,9 +444,6 @@ wl_resource_destroy(struct wl_resource *resource)
|
|||
id = resource->object.id;
|
||||
destroy_resource(resource, NULL);
|
||||
|
||||
if (!(wl_map_lookup_flags(&client->objects, id) & WL_MAP_ENTRY_LEGACY))
|
||||
free(resource);
|
||||
|
||||
if (id < WL_SERVER_ID_START) {
|
||||
if (client->display_resource) {
|
||||
wl_resource_queue_event(client->display_resource,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue