mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2025-12-31 20:36:25 +00:00
libsysprof-analyze: clean up descendant node tree on finalize
This commit is contained in:
@ -78,5 +78,7 @@ SysprofCallgraph *_sysprof_callgraph_new_finish (GAsyncResult
|
||||
GError **error);
|
||||
gpointer _sysprof_callgraph_get_symbol_augment (SysprofCallgraph *self,
|
||||
SysprofSymbol *symbol);
|
||||
void _sysprof_callgraph_node_free (SysprofCallgraphNode *self,
|
||||
gboolean free_self);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
@ -109,10 +109,9 @@ sysprof_callgraph_get_summary (SysprofCallgraph *self,
|
||||
|
||||
return summary;
|
||||
}
|
||||
|
||||
static void
|
||||
sysprof_callgraph_node_free (SysprofCallgraphNode *node,
|
||||
gboolean free_self)
|
||||
void
|
||||
_sysprof_callgraph_node_free (SysprofCallgraphNode *node,
|
||||
gboolean free_self)
|
||||
{
|
||||
SysprofCallgraphNode *iter = node->children;
|
||||
|
||||
@ -120,7 +119,7 @@ sysprof_callgraph_node_free (SysprofCallgraphNode *node,
|
||||
{
|
||||
SysprofCallgraphNode *to_free = iter;
|
||||
iter = iter->next;
|
||||
sysprof_callgraph_node_free (to_free, TRUE);
|
||||
_sysprof_callgraph_node_free (to_free, TRUE);
|
||||
}
|
||||
|
||||
if (free_self)
|
||||
@ -156,7 +155,7 @@ sysprof_callgraph_finalize (GObject *object)
|
||||
g_clear_object (&self->document);
|
||||
g_clear_object (&self->traceables);
|
||||
|
||||
sysprof_callgraph_node_free (&self->root, FALSE);
|
||||
_sysprof_callgraph_node_free (&self->root, FALSE);
|
||||
|
||||
G_OBJECT_CLASS (sysprof_callgraph_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
@ -56,8 +56,6 @@ sysprof_descendants_model_get_item (GListModel *model,
|
||||
if (position != 0)
|
||||
return NULL;
|
||||
|
||||
g_warning ("TODO: Need to get proper ownership for node and proper summary");
|
||||
|
||||
return _sysprof_callgraph_frame_new_for_node (self->callgraph, G_OBJECT (self), &self->root);
|
||||
}
|
||||
|
||||
@ -77,6 +75,8 @@ sysprof_descendants_model_finalize (GObject *object)
|
||||
{
|
||||
SysprofDescendantsModel *self = (SysprofDescendantsModel *)object;
|
||||
|
||||
_sysprof_callgraph_node_free (&self->root, FALSE);
|
||||
|
||||
g_clear_object (&self->callgraph);
|
||||
g_clear_object (&self->symbol);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user