[gthumb] fixed crash when no tag is specified in the comment dialog



commit 037456a44db93834e5d746bb6023ea0d923ffa11
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Fri Aug 13 12:33:18 2010 +0200

    fixed crash when no tag is specified in the comment dialog

 extensions/edit_metadata/gth-edit-comment-page.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/extensions/edit_metadata/gth-edit-comment-page.c b/extensions/edit_metadata/gth-edit-comment-page.c
index b188bc8..5b91fd9 100644
--- a/extensions/edit_metadata/gth-edit-comment-page.c
+++ b/extensions/edit_metadata/gth-edit-comment-page.c
@@ -271,8 +271,12 @@ gth_edit_comment_page_real_update_info (GthEditMetadataPage *base,
 		string_list = gth_string_list_new (tags);
 	else
 		string_list = NULL;
-	if (! only_modified_fields || ! gth_file_data_attribute_equal_string_list (file_data, "general::tags", string_list))
-		g_file_info_set_attribute_object (info, "general::tags", G_OBJECT (string_list));
+	if (! only_modified_fields || ! gth_file_data_attribute_equal_string_list (file_data, "general::tags", string_list)) {
+		if (string_list != NULL)
+			g_file_info_set_attribute_object (info, "general::tags", G_OBJECT (string_list));
+		else
+			g_file_info_remove_attribute (info, "general::tags");
+	}
 
 	/* rating */
 
@@ -293,7 +297,7 @@ gth_edit_comment_page_real_update_info (GthEditMetadataPage *base,
 
 	g_free (s);
 	g_free (exif_date);
-	g_object_unref (string_list);
+	_g_object_unref (string_list);
 	g_strfreev (tagv);
 	g_list_free (tags);
 	g_object_unref (file_data);



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