diff --git a/src/libsysprof-analyze/sysprof-callgraph.c b/src/libsysprof-analyze/sysprof-callgraph.c index bf3af842..56d5c8a0 100644 --- a/src/libsysprof-analyze/sysprof-callgraph.c +++ b/src/libsysprof-analyze/sysprof-callgraph.c @@ -166,6 +166,7 @@ sysprof_callgraph_populate_callers (SysprofCallgraph *self, iter = iter->parent) { GPtrArray *callers; + guint pos; if (!(callers = g_hash_table_lookup (hash, iter->symbol))) { @@ -175,7 +176,8 @@ sysprof_callgraph_populate_callers (SysprofCallgraph *self, g_assert (iter->parent->symbol != NULL); - g_ptr_array_add (callers, iter->parent->symbol); + if (!g_ptr_array_find (callers, iter->parent->symbol, &pos)) + g_ptr_array_add (callers, iter->parent->symbol); } }