[eog/wip/friemann/image-ref-cnt: 3/3] EogWindow: Drop reference on unchanged images




commit 6478411b29a18ba58ea53f5141da45c10fe7401d
Author: Felix Riemann <friemann gnome org>
Date:   Wed Dec 2 22:25:27 2020 +0100

    EogWindow: Drop reference on unchanged images
    
    Building the save confirmation dialog when closing a window adds a
    new reference on every image in the collection. For unchanged images this
    reference needs to be dropped again as the image is not kept.

 src/eog-window.c | 2 ++
 1 file changed, 2 insertions(+)
---
diff --git a/src/eog-window.c b/src/eog-window.c
index 65ed41a8..1078ca5e 100644
--- a/src/eog-window.c
+++ b/src/eog-window.c
@@ -2433,6 +2433,8 @@ eog_window_unsaved_images_confirm (EogWindow *window)
 
                        if (eog_image_is_modified (image)) {
                                list = g_list_prepend (list, image);
+                       } else {
+                               g_object_unref (image);
                        }
                } while (gtk_tree_model_iter_next (GTK_TREE_MODEL (priv->store), &iter));
        }


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