From ea67537d859ee415e7cc0c0666a152b29e458d09 Mon Sep 17 00:00:00 2001 From: Jehan Date: Mon, 10 Sep 2018 15:54:09 +0200 Subject: [PATCH] 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 --- app/core/gimpimage-convert-precision.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/app/core/gimpimage-convert-precision.c b/app/core/gimpimage-convert-precision.c index bcf11186b9..04e6b6efc6 100644 --- a/app/core/gimpimage-convert-precision.c +++ b/app/core/gimpimage-convert-precision.c @@ -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);