[nautilus/wip/antoniof/template-leaks: 5/6] window-slot: Don't leak icon reference




commit 73daad58ef9e55f15c8bc697d1614aab18ebad29
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.
    
    Leak found in valgrind file provided by nekohayo

 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]