[gtk+] GtkListBox: ref_sink new object in set_header and set_adjustment



commit 5ed8db986fbfe1720d360af502b99aabd45d9312
Author: Alexander Larsson <alexl redhat com>
Date:   Wed Sep 4 21:00:23 2013 +0200

    GtkListBox: ref_sink new object in set_header and set_adjustment
    
    These are taking ownership of the object in the hierarchy, so should
    sink any floating refs to make it easy to use in C code.

 gtk/gtklistbox.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtklistbox.c b/gtk/gtklistbox.c
index f9545a5..9d2d071 100644
--- a/gtk/gtklistbox.c
+++ b/gtk/gtklistbox.c
@@ -626,7 +626,7 @@ gtk_list_box_set_adjustment (GtkListBox    *list_box,
 
   g_return_if_fail (list_box != NULL);
 
-  g_object_ref (adjustment);
+  g_object_ref_sink (adjustment);
   if (priv->adjustment)
     g_object_unref (priv->adjustment);
   priv->adjustment = adjustment;
@@ -2736,7 +2736,7 @@ gtk_list_box_row_set_header (GtkListBoxRow *row,
   priv->header = header;
 
   if (header)
-    g_object_ref (header);
+    g_object_ref_sink (header);
 }
 
 /**


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