[gthumb] test category: keep a ref of the store until the object is finilized



commit 076508f6964241a4cdc378a87b8d3e0df120ba09
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Tue Mar 6 14:39:35 2012 +0100

    test category: keep a ref of the store until the object is finilized

 gthumb/gth-test-category.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/gthumb/gth-test-category.c b/gthumb/gth-test-category.c
index f7ca177..ba94c69 100644
--- a/gthumb/gth-test-category.c
+++ b/gthumb/gth-test-category.c
@@ -92,6 +92,7 @@ gth_test_category_finalize (GObject *object)
 			g_signal_handler_disconnect (gth_main_get_default_monitor (), test->priv->monitor_events);
 			test->priv->monitor_events = 0;
 		}
+		_g_object_unref (test->priv->tag_store);
 		g_free (test->priv->category);
 		g_free (test->priv);
 		test->priv = NULL;
@@ -213,7 +214,6 @@ gth_test_category_real_create_control (GthTest *base)
 	test->priv->tag_store = gtk_list_store_new (1, G_TYPE_STRING);
 	test->priv->combo_entry = gtk_combo_box_new_with_model_and_entry (GTK_TREE_MODEL (test->priv->tag_store));
 	gtk_combo_box_set_entry_text_column (GTK_COMBO_BOX (test->priv->combo_entry), 0);
-	g_object_unref (test->priv->tag_store);
 	update_tag_list (test);
 
 	test->priv->text_entry = gtk_bin_get_child (GTK_BIN (test->priv->combo_entry));
@@ -265,7 +265,7 @@ gth_test_category_real_match (GthTest     *test,
 		GList         *list, *scan;
 		char          *test_category_casefolded;
 
-		string_list = (GthStringList *) g_file_info_get_attribute_object (file->info, gth_test_get_attributes (GTH_TEST (test_category)));
+		string_list = GTH_STRING_LIST (g_file_info_get_attribute_object (file->info, gth_test_get_attributes (GTH_TEST (test_category))));
 		if (string_list != NULL)
 			list = gth_string_list_get_list (string_list);
 		else
@@ -449,6 +449,7 @@ gth_test_category_init (GthTestCategory *test)
 {
 	test->priv = g_new0 (GthTestCategoryPrivate, 1);
 	test->priv->monitor_events = 0;
+	test->priv->tag_store = NULL;
 }
 
 



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