mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2025-12-31 20:36:25 +00:00
libsysprof-analyze: free callgraph node tree on finalize
This commit is contained in:
@ -80,6 +80,23 @@ list_model_iface_init (GListModelInterface *iface)
|
||||
G_DEFINE_FINAL_TYPE_WITH_CODE (SysprofCallgraph, sysprof_callgraph, G_TYPE_OBJECT,
|
||||
G_IMPLEMENT_INTERFACE (G_TYPE_LIST_MODEL, list_model_iface_init))
|
||||
|
||||
static void
|
||||
sysprof_callgraph_node_free (SysprofCallgraphNode *node,
|
||||
gboolean free_self)
|
||||
{
|
||||
SysprofCallgraphNode *iter = node->children;
|
||||
|
||||
while (iter)
|
||||
{
|
||||
SysprofCallgraphNode *to_free = iter;
|
||||
iter = iter->next;
|
||||
sysprof_callgraph_node_free (to_free, TRUE);
|
||||
}
|
||||
|
||||
if (free_self)
|
||||
g_free (node);
|
||||
}
|
||||
|
||||
static void
|
||||
sysprof_callgraph_dispose (GObject *object)
|
||||
{
|
||||
@ -107,6 +124,8 @@ sysprof_callgraph_finalize (GObject *object)
|
||||
g_clear_object (&self->traceables);
|
||||
g_clear_object (&self->everything);
|
||||
|
||||
sysprof_callgraph_node_free (&self->root, FALSE);
|
||||
|
||||
G_OBJECT_CLASS (sysprof_callgraph_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user