[eog/wip/friemann/image-ref-cnt: 1/3] EogMetadataSidebar: Release image reference at dispose




commit 0e0c116bc0803e30cddefee71243fa85b923cc69
Author: Felix Riemann <friemann gnome org>
Date:   Wed Dec 2 22:19:32 2020 +0100

    EogMetadataSidebar: Release image reference at dispose
    
    Otherwise the reference will keep the image alive when the window
    is closed.

 src/eog-metadata-sidebar.c | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)
---
diff --git a/src/eog-metadata-sidebar.c b/src/eog-metadata-sidebar.c
index 010db48b..87853297 100644
--- a/src/eog-metadata-sidebar.c
+++ b/src/eog-metadata-sidebar.c
@@ -418,6 +418,19 @@ eog_metadata_sidebar_set_property (GObject *object, guint property_id,
        }
 
 }
+
+static void
+eog_metadata_sidebar_dispose (GObject *object)
+{
+       EogMetadataSidebarPrivate *priv;
+
+       priv = EOG_METADATA_SIDEBAR (object)->priv;
+
+       g_clear_object (&priv->image);
+
+       G_OBJECT_CLASS (eog_metadata_sidebar_parent_class)->dispose (object);
+}
+
 static void
 eog_metadata_sidebar_class_init (EogMetadataSidebarClass *klass)
 {
@@ -426,7 +439,7 @@ eog_metadata_sidebar_class_init (EogMetadataSidebarClass *klass)
 
        g_obj_class->get_property = eog_metadata_sidebar_get_property;
        g_obj_class->set_property = eog_metadata_sidebar_set_property;
-/*     g_obj_class->dispose = eog_metadata_sidebar_dispose;*/
+       g_obj_class->dispose = eog_metadata_sidebar_dispose;
 
        g_object_class_install_property (
                g_obj_class, PROP_PARENT_WINDOW,


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