diff --git a/src/backends/meta-color-device.c b/src/backends/meta-color-device.c index 5533a8ece..3032d34c2 100644 --- a/src/backends/meta-color-device.c +++ b/src/backends/meta-color-device.c @@ -889,12 +889,10 @@ create_icc_profile_from_edid (MetaColorDevice *color_device, cmsSetHeaderRenderingIntent (lcms_profile, INTENT_PERCEPTUAL); cmsSetDeviceClass (lcms_profile, cmsSigDisplayClass); - if (!cd_icc_load_handle (cd_icc, lcms_profile, + g_warn_if_fail (cmsGetProfileContextID (lcms_profile)); + if (!cd_icc_load_handle (cd_icc, g_steal_pointer (&lcms_profile), CD_ICC_LOAD_FLAGS_PRIMARIES, error)) - { - cmsCloseProfile (lcms_profile); - return NULL; - } + return NULL; cd_icc_add_metadata (cd_icc, CD_PROFILE_PROPERTY_FILENAME, file_path); cd_icc_add_metadata (cd_icc,