[gtk/wip/otte/for-main] listitemwidget: Actually unref the listitems




commit 918dd66dca14c7827bdfcce0a19d6dde12030d6a
Author: Benjamin Otte <otte redhat com>
Date:   Sun Aug 14 22:55:27 2022 +0200

    listitemwidget: Actually unref the listitems
    
    Fixes #5102

 gtk/gtklistitemwidget.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/gtk/gtklistitemwidget.c b/gtk/gtklistitemwidget.c
index c62b59f3a2..8681265db6 100644
--- a/gtk/gtklistitemwidget.c
+++ b/gtk/gtklistitemwidget.c
@@ -209,14 +209,16 @@ static void
 gtk_list_item_widget_teardown_factory (GtkListItemWidget *self)
 {
   GtkListItemWidgetPrivate *priv = gtk_list_item_widget_get_instance_private (self);
+  GtkListItem *list_item = priv->list_item;
 
   gtk_list_item_factory_teardown (priv->factory,
-                                  G_OBJECT (priv->list_item),
+                                  G_OBJECT (list_item),
                                   priv->item != NULL,
                                   gtk_list_item_widget_teardown_func,
                                   self);
 
   g_assert (priv->list_item == NULL);
+  g_object_unref (list_item);
 }
 
 static void


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]