[tracker] libtracker-data: Fix assertion failure when ontology cache fails to load
- From: Jürg Billeter <juergbi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker] libtracker-data: Fix assertion failure when ontology cache fails to load
- Date: Thu, 13 Jan 2011 15:30:34 +0000 (UTC)
commit 4f50b7b729f86b5f3ca1a5c80fa781051fe7b6ae
Author: Jürg Billeter <j bitron ch>
Date: Thu Jan 13 16:21:47 2011 +0100
libtracker-data: Fix assertion failure when ontology cache fails to load
src/libtracker-data/tracker-data-manager.c | 9 ++++++++-
src/libtracker-data/tracker-ontologies.c | 3 +++
2 files changed, 11 insertions(+), 1 deletions(-)
---
diff --git a/src/libtracker-data/tracker-data-manager.c b/src/libtracker-data/tracker-data-manager.c
index c92600c..102e63c 100644
--- a/src/libtracker-data/tracker-data-manager.c
+++ b/src/libtracker-data/tracker-data-manager.c
@@ -3433,8 +3433,15 @@ tracker_data_manager_init (TrackerDBManagerFlags flags,
it reduces initialization time */
create_decomposed_transient_metadata_tables (iface);
} else {
- load_ontologies_gvdb (NULL);
+ GError *gvdb_error = NULL;
+
+ load_ontologies_gvdb (&gvdb_error);
check_ontology = FALSE;
+
+ if (gvdb_error) {
+ g_error ("Error loading ontology cache: %s",
+ gvdb_error->message);
+ }
}
/* This is a no-op when FTS is disabled */
diff --git a/src/libtracker-data/tracker-ontologies.c b/src/libtracker-data/tracker-ontologies.c
index c09699d..bed8210 100644
--- a/src/libtracker-data/tracker-ontologies.c
+++ b/src/libtracker-data/tracker-ontologies.c
@@ -584,6 +584,9 @@ tracker_ontologies_load_gvdb (const gchar *filename,
tracker_ontologies_init ();
gvdb_table = gvdb_table_new (filename, TRUE, error);
+ if (!gvdb_table) {
+ return;
+ }
gvdb_namespaces_table = gvdb_table_get_table (gvdb_table, "namespaces");
gvdb_classes_table = gvdb_table_get_table (gvdb_table, "classes");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]