color-lcms: unref stock sRGB cprof instead of directly destroying it
Directly destroying the cprof is not ideal, because it may hide issues that we have in the code. If we are destroying a cprof with ref_count bigger than 1, there's something wrong that we need to fix. Instead, assert that the stock sRGB cprof has ref_count == 1 when we are destroying the color manager. And use unref() instead of destroy(). Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
This commit is contained in:
parent
d18fd64a15
commit
39de0bd988
@ -381,8 +381,11 @@ cmlcms_destroy(struct weston_color_manager *cm_base)
|
||||
{
|
||||
struct weston_color_manager_lcms *cm = get_cmlcms(cm_base);
|
||||
|
||||
if (cm->sRGB_profile)
|
||||
cmlcms_color_profile_destroy(cm->sRGB_profile);
|
||||
if (cm->sRGB_profile) {
|
||||
assert(cm->sRGB_profile->base.ref_count == 1);
|
||||
unref_cprof(cm->sRGB_profile);
|
||||
}
|
||||
|
||||
assert(wl_list_empty(&cm->color_transform_list));
|
||||
assert(wl_list_empty(&cm->color_profile_list));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user