mirror of
https://gitlab.freedesktop.org/wayland/weston.git
synced 2026-05-07 04:58:16 +02:00
color: dissolve cm_image_desc_destroy()
The only legal way to destroy a cm_image_desc is to go through the wl_resource destruction. Calling the function otherwise would have left a dangling pointer in the resource. Let's not have the temptation to "fix" that dangling pointer. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
This commit is contained in:
parent
ae62283724
commit
a27efd5ad8
1 changed files with 2 additions and 14 deletions
|
|
@ -423,9 +423,6 @@ image_description_destroy(struct wl_client *client,
|
|||
wl_resource_destroy(cm_image_desc_res);
|
||||
}
|
||||
|
||||
static void
|
||||
cm_image_desc_destroy(struct cm_image_desc *cm_image_desc);
|
||||
|
||||
/**
|
||||
* Resource destruction function for the image description. Destroys the image
|
||||
* description backing object.
|
||||
|
|
@ -441,7 +438,8 @@ image_description_resource_destroy(struct wl_resource *cm_image_desc_res)
|
|||
if (!cm_image_desc)
|
||||
return;
|
||||
|
||||
cm_image_desc_destroy(cm_image_desc);
|
||||
weston_color_profile_unref(cm_image_desc->cprof);
|
||||
free(cm_image_desc);
|
||||
}
|
||||
|
||||
static const struct wp_image_description_v1_interface
|
||||
|
|
@ -499,16 +497,6 @@ link_image_description_resource(struct weston_color_manager *cm,
|
|||
cm_image_desc->cprof->id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Destroy an image description object.
|
||||
*/
|
||||
static void
|
||||
cm_image_desc_destroy(struct cm_image_desc *cm_image_desc)
|
||||
{
|
||||
weston_color_profile_unref(cm_image_desc->cprof);
|
||||
free(cm_image_desc);
|
||||
}
|
||||
|
||||
/**
|
||||
* Called by clients when they want to get the output's image description.
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue