[tracker/tracker-0.6] Fixes NB#126185, tracker-extract[1413]: GLIB CRITICAL ** GLib-GObject - g_object_unref: assertion `G



commit cb23dfd5fe41d747c75e0b155f2095439428c960
Author: Mikael Ottela <mikael ottela ixonos com>
Date:   Fri Oct 9 14:19:03 2009 +0300

    Fixes NB#126185, tracker-extract[1413]: GLIB CRITICAL ** GLib-GObject - g_object_unref: assertion `G_IS_OBJECT (object)' failed

 src/tracker-extract/tracker-extract-albumart.c     |    5 ++++-
 .../tracker-extract-gstreamer-helix.c              |   10 +++++++++-
 src/tracker-extract/tracker-extract.c              |    5 +++--
 3 files changed, 16 insertions(+), 4 deletions(-)
---
diff --git a/src/tracker-extract/tracker-extract-albumart.c b/src/tracker-extract/tracker-extract-albumart.c
index 6ac17e6..f521309 100644
--- a/src/tracker-extract/tracker-extract-albumart.c
+++ b/src/tracker-extract/tracker-extract-albumart.c
@@ -175,7 +175,10 @@ tracker_process_albumart (const unsigned char *buffer,
 			dirf = g_file_get_parent (file);
 			dirname = g_file_get_path (dirf);
 			g_object_unref (file);
-			g_object_unref (dirf);
+
+			if (dirf) {
+				g_object_unref (dirf);
+			}
 
 			key = g_strdup_printf ("%s-%s-%s", artist ? artist : "",
 					       album ? album : "",
diff --git a/src/tracker-extract/tracker-extract-gstreamer-helix.c b/src/tracker-extract/tracker-extract-gstreamer-helix.c
index 1038de0..0733366 100644
--- a/src/tracker-extract/tracker-extract-gstreamer-helix.c
+++ b/src/tracker-extract/tracker-extract-gstreamer-helix.c
@@ -146,6 +146,14 @@ caps_set_video (GObject		  *object,
 }
 
 static void
+free_stream_info (gpointer data)
+{
+	if (data) {
+		g_object_unref (data);
+	}
+}
+
+static void
 update_stream_info (MetadataExtractor *extractor)
 {
 	GList  *streaminfo;
@@ -209,7 +217,7 @@ update_stream_info (MetadataExtractor *extractor)
 		}
 	}
 
-	g_list_foreach (streaminfo, (GFunc) g_object_unref, NULL);
+	g_list_foreach (streaminfo, (GFunc) free_stream_info, NULL);
 	g_list_free (streaminfo);
 }
 
diff --git a/src/tracker-extract/tracker-extract.c b/src/tracker-extract/tracker-extract.c
index ee14a4d..c66b256 100644
--- a/src/tracker-extract/tracker-extract.c
+++ b/src/tracker-extract/tracker-extract.c
@@ -182,8 +182,9 @@ print_file_metadata_item (gpointer key,
 {
 	gchar *value_utf8;
 
-	g_return_if_fail (key != NULL);
-	g_return_if_fail (value != NULL);
+	if (!key || !value) {
+		return;
+	}
 
 	value_utf8 = g_locale_to_utf8 (value, -1, NULL, NULL, NULL);
 



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