[eog/gnome-3-36] EogJobSave: Do not unref current image pointer at dispose



commit 22c88e49607925f37fa0ac94927fddb669c4d75c
Author: Felix Riemann <friemann gnome org>
Date:   Sat Oct 17 17:03:49 2020 +0200

    EogJobSave: Do not unref current image pointer at dispose
    
    The pointer was not ref'd before as it is only an iterator into
    the larger image list held by the job. So, simply make sure to unset
    it before clearing the image list.
    
    Fixes #154.
    
    (cherry picked from commit 0fb6006e91721f8cede8d87f8836f0dfcec51686)

 src/eog-jobs.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
---
diff --git a/src/eog-jobs.c b/src/eog-jobs.c
index c1813b21..59108554 100644
--- a/src/eog-jobs.c
+++ b/src/eog-jobs.c
@@ -894,6 +894,8 @@ void eog_job_save_dispose (GObject *object)
 
        job = EOG_JOB_SAVE (object);
 
+       job->current_image = NULL;
+
        /* free all public and private members */
        if (job->images) {
                g_list_foreach (job->images, (GFunc) g_object_unref, NULL);
@@ -901,11 +903,6 @@ void eog_job_save_dispose (GObject *object)
                job->images = NULL;
        }
 
-       if (job->current_image) {
-               g_object_unref (job->current_image);
-               job->current_image = NULL;
-       }
-
        /* call parent dispose */
        G_OBJECT_CLASS (eog_job_save_parent_class)->dispose (object);
 }


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