From 3ace7575f7a25d7e77498e2bae9786bdebcf7a16 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Mon, 7 Nov 2022 17:49:00 +0100 Subject: [PATCH] gs-screenshot-carousel: First ref_sink() img widget before discarding it As the GtkWidget is an object with a floating reference, there's needed to ref_sink() it forst before unreffing it with g_object_unref(), otherwise there is a runtime warning on the console: 16:42:50:751 Gtk A floating object was finalized. This means that someone called g_object_unref() on an object that had only a floating reference; the initial floating reference is not owned by anyone and must be removed with g_object_ref_sink(). --- src/gs-screenshot-carousel.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gs-screenshot-carousel.c b/src/gs-screenshot-carousel.c index 828a741cc..d3111afd4 100644 --- a/src/gs-screenshot-carousel.c +++ b/src/gs-screenshot-carousel.c @@ -152,6 +152,7 @@ gs_screenshot_carousel_load_screenshots (GsScreenshotCarousel *self, GsApp *app, * thumbnails otherwise */ if (!is_online && !gs_screenshot_image_is_showing (GS_SCREENSHOT_IMAGE (ssimg))) { + g_object_ref_sink (ssimg); g_object_unref (ssimg); continue; } -- GitLab