Commit 5e9ad3ec authored by Sam Thursfield's avatar Sam Thursfield

Fix crash in read-only mode when ontologies.gdvb is missing

We shouldn't unref the manager->ontologies object if loading the
new ontologies failed. Fixes a crash in the fallback code path.
parent ca0bb0d4
Pipeline #65015 passed with stage
in 2 minutes and 3 seconds
...@@ -3954,6 +3954,7 @@ static void ...@@ -3954,6 +3954,7 @@ static void
load_ontologies_gvdb (TrackerDataManager *manager, load_ontologies_gvdb (TrackerDataManager *manager,
GError **error) GError **error)
{ {
TrackerOntologies *ontologies;
gchar *filename; gchar *filename;
GFile *child; GFile *child;
...@@ -3961,8 +3962,12 @@ load_ontologies_gvdb (TrackerDataManager *manager, ...@@ -3961,8 +3962,12 @@ load_ontologies_gvdb (TrackerDataManager *manager,
filename = g_file_get_path (child); filename = g_file_get_path (child);
g_object_unref (child); g_object_unref (child);
g_object_unref (manager->ontologies); ontologies = tracker_ontologies_load_gvdb (filename, error);
manager->ontologies = tracker_ontologies_load_gvdb (filename, error);
if (ontologies != NULL) {
g_object_unref (manager->ontologies);
manager->ontologies = ontologies;
}
g_free (filename); g_free (filename);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment