[gthumb] find: fixed crash when changing test



commit 4ae4da231e8a5b7a36a5f6f7010ccb7652211139
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Sun Jan 3 14:56:40 2016 +0100

    find: fixed crash when changing test

 gthumb/gth-test-selector.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/gthumb/gth-test-selector.c b/gthumb/gth-test-selector.c
index a62fe42..69273d4 100644
--- a/gthumb/gth-test-selector.c
+++ b/gthumb/gth-test-selector.c
@@ -343,9 +343,10 @@ void
 gth_test_selector_set_test (GthTestSelector *self,
                            GthTest         *test)
 {
+       GthTest   *old_test;
        GtkWidget *control;
 
-       _g_object_unref (self->priv->test);
+       old_test = self->priv->test;
        if (test != NULL)
                self->priv->test = (GthTest *) gth_duplicable_duplicate (GTH_DUPLICABLE (test));
        else
@@ -376,6 +377,8 @@ gth_test_selector_set_test (GthTestSelector *self,
                gtk_container_add (GTK_CONTAINER (self->priv->control_box),
                                   self->priv->control);
        }
+
+       _g_object_unref (old_test);
 }
 
 


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