From e0564ae69dfb49b55b06af29e0dc7ab60e1979f3 Mon Sep 17 00:00:00 2001 From: Simon Budig Date: Sun, 5 May 2024 23:57:02 +0200 Subject: [PATCH] libgimpwidgets: don't leak dest_profile --- libgimpwidgets/gimpwidgetsutils.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/libgimpwidgets/gimpwidgetsutils.c b/libgimpwidgets/gimpwidgetsutils.c index 96d586306f..38133a3a19 100644 --- a/libgimpwidgets/gimpwidgetsutils.c +++ b/libgimpwidgets/gimpwidgetsutils.c @@ -1099,9 +1099,13 @@ gimp_widget_get_render_space (GtkWidget *widget, dest_profile = gimp_widget_get_color_profile (gtk_widget_get_toplevel (widget)); if (dest_profile) - space = gimp_color_profile_get_space (dest_profile, - GIMP_COLOR_RENDERING_INTENT_RELATIVE_COLORIMETRIC, - NULL); + { + space = gimp_color_profile_get_space (dest_profile, + GIMP_COLOR_RENDERING_INTENT_RELATIVE_COLORIMETRIC, + NULL); + g_object_unref (dest_profile); + } + return space; }