[tracker/wip/carlosg/transact-graphs: 2/4] libtracker-data: Keep copy of graphs to iterate
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/wip/carlosg/transact-graphs: 2/4] libtracker-data: Keep copy of graphs to iterate
- Date: Sun, 23 Aug 2020 21:57:12 +0000 (UTC)
commit 1e1a877a33b2ed1f3178ba07081e41a60e1a9314
Author: Carlos Garnacho <carlosg gnome org>
Date: Sun Aug 23 23:50:38 2020 +0200
libtracker-data: Keep copy of graphs to iterate
The graph hashtable and the referenced strings might change as
the list is traversed. Make sure we are dealing with our own strings
here.
src/libtracker-data/tracker-sparql.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/src/libtracker-data/tracker-sparql.c b/src/libtracker-data/tracker-sparql.c
index 650807dbe..22a5459f9 100644
--- a/src/libtracker-data/tracker-sparql.c
+++ b/src/libtracker-data/tracker-sparql.c
@@ -3908,11 +3908,11 @@ translate_Drop (TrackerSparql *sparql,
g_hash_table_iter_init (&iter, ht);
while (g_hash_table_iter_next (&iter, (gpointer *) &graph, NULL))
- graphs = g_list_prepend (graphs, (gpointer) graph);
+ graphs = g_list_prepend (graphs, g_strdup (graph));
}
} else {
graph = tracker_token_get_idstring (&sparql->current_state.graph);
- graphs = g_list_prepend (graphs, (gpointer) graph);
+ graphs = g_list_prepend (graphs, g_strdup (graph));
}
for (l = graphs; l; l = l->next) {
@@ -3929,7 +3929,7 @@ translate_Drop (TrackerSparql *sparql,
break;
}
- g_list_free (graphs);
+ g_list_free_full (graphs, g_free);
return handle_silent (silent, inner_error, error);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]