From ebc525f44a8cbb0ca49e20b064ee9fecbd515097 Mon Sep 17 00:00:00 2001 From: Oleksiy Yakovenko Date: Fri, 17 Nov 2023 21:36:28 +0100 Subject: [PATCH] gtkui: medialib cover art pixbuf reference counting fix --- plugins/gtkui/medialib/mlcellrendererpixbuf.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/plugins/gtkui/medialib/mlcellrendererpixbuf.c b/plugins/gtkui/medialib/mlcellrendererpixbuf.c index 51f6ced97d..a8eef01c3c 100644 --- a/plugins/gtkui/medialib/mlcellrendererpixbuf.c +++ b/plugins/gtkui/medialib/mlcellrendererpixbuf.c @@ -105,7 +105,14 @@ _set_property ( break; } case PROP_PIXBUF: + if (cellpixbuf->pixbuf != NULL) { + g_object_unref (cellpixbuf->pixbuf); + cellpixbuf->pixbuf = NULL; + } cellpixbuf->pixbuf = g_value_get_object (value); + if (cellpixbuf->pixbuf != NULL) { + g_object_ref (cellpixbuf->pixbuf); + } break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);