[nautilus/wip/antoniof/meets-valgrind: 1/11] window-slot: Don't leak icon reference




commit 52eb54132df9dbc35e41994d39582b1eb0509595
Author: António Fernandes <antoniof gnome org>
Date:   Sat Dec 19 13:20:59 2020 +0000

    window-slot: Don't leak icon reference
    
    g_value_set_object() increases the reference count of the passed object
    
    But we already own a reference, so we end up leaking it.
    
    Use g_value_take_object() to reuse the owned reference instead.

 src/nautilus-window-slot.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/src/nautilus-window-slot.c b/src/nautilus-window-slot.c
index b5ff00008..32a3590a3 100644
--- a/src/nautilus-window-slot.c
+++ b/src/nautilus-window-slot.c
@@ -911,7 +911,7 @@ nautilus_window_slot_get_property (GObject    *object,
 
         case PROP_ICON:
         {
-            g_value_set_object (value, nautilus_window_slot_get_icon (self));
+            g_value_take_object (value, nautilus_window_slot_get_icon (self));
         }
         break;
 


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