app: conditionnally free new profile in gimp_image_convert_precision().

Do not free a NULL pointer! This fixes a CRITICAL:
> g_object_unref: assertion 'G_IS_OBJECT (object)' failed
This commit is contained in:
Jehan 2018-09-10 15:54:09 +02:00
parent 6c6a7514a4
commit ea67537d85
1 changed files with 7 additions and 4 deletions

View File

@ -191,11 +191,14 @@ gimp_image_convert_precision (GimpImage *image,
}
if (new_profile)
gimp_image_set_color_profile (image, new_profile, NULL);
{
gimp_image_set_color_profile (image, new_profile, NULL);
g_object_unref (new_profile);
}
else
gimp_color_managed_profile_changed (GIMP_COLOR_MANAGED (image));
g_object_unref (new_profile);
{
gimp_color_managed_profile_changed (GIMP_COLOR_MANAGED (image));
}
gimp_image_undo_group_end (image);