[eog/wip/friemann/image-ref-cnt: 2/3] EogListStore: Release initial reference on new EogImages




commit 4364769bfe36904de1e6483c38bd3dccfe5e02d2
Author: Felix Riemann <friemann gnome org>
Date:   Wed Dec 2 22:23:58 2020 +0100

    EogListStore: Release initial reference on new EogImages
    
    Adding it to the ListStore will add another reference, so the initial
    one needs to be dropped.

 src/eog-list-store.c | 3 +++
 1 file changed, 3 insertions(+)
---
diff --git a/src/eog-list-store.c b/src/eog-list-store.c
index c7991778..baeada40 100644
--- a/src/eog-list-store.c
+++ b/src/eog-list-store.c
@@ -368,6 +368,8 @@ eog_list_store_append_image_from_file (EogListStore *store,
        image = eog_image_new_file (file, caption);
 
        eog_list_store_append_image (store, image);
+
+       g_object_unref (image);
 }
 
 static void
@@ -527,6 +529,7 @@ directory_visit (GFile *directory,
                child = g_file_get_child (directory, name);
                caption = g_file_info_get_display_name (children_info);
                eog_list_store_append_image_from_file (store, child, caption);
+               g_object_unref(child);
        }
 }
 


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