[tracker/tracker-0.6] Fixes NB#124483, Glib critical failing on assertion



commit ba1b095dfb715cdc0e55ffce5fd4b8b409aab8d7
Author: Ivan Frade <ivan frade nokia com>
Date:   Thu Jun 25 13:17:00 2009 +0300

    Fixes NB#124483, Glib critical failing on assertion
    
    Store object references instead of pointers in the ontology
    parent_services cache.

 src/libtracker-common/tracker-ontology.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/src/libtracker-common/tracker-ontology.c b/src/libtracker-common/tracker-ontology.c
index 1e876b3..b3c3222 100644
--- a/src/libtracker-common/tracker-ontology.c
+++ b/src/libtracker-common/tracker-ontology.c
@@ -203,6 +203,9 @@ tracker_ontology_shutdown (void)
 	}
 
 	if (parent_services) {
+		g_slist_foreach (parent_services,
+				 g_object_unref,
+				 NULL);
 		g_slist_free (parent_services);
 		parent_services = NULL;
 	}
@@ -238,7 +241,7 @@ tracker_ontology_service_add (TrackerService *service,
 
 	if (tracker_service_get_parent (service) == NULL ||
 	    g_strcmp0 (tracker_service_get_parent (service), " ") == 0) {
-		parent_services = g_slist_prepend (parent_services, service);
+		parent_services = g_slist_prepend (parent_services, g_object_ref (service));
 	}
 
 	for (l = mimes; l && l->data; l = l->next) {



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