mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2026-02-11 07:30:54 +00:00
libsysprof-analyze: use weak backpointers for child listmodel
This commit is contained in:
@ -201,7 +201,7 @@ sysprof_callgraph_symbol_list_model_get_item (GListModel *model,
|
|||||||
{
|
{
|
||||||
SysprofCallgraphSymbolListModel *self = (SysprofCallgraphSymbolListModel *)model;
|
SysprofCallgraphSymbolListModel *self = (SysprofCallgraphSymbolListModel *)model;
|
||||||
|
|
||||||
if (self->symbols == NULL || position >= self->symbols->len)
|
if (self->symbols == NULL || position >= self->symbols->len || self->callgraph == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
return _sysprof_callgraph_symbol_new (self->callgraph,
|
return _sysprof_callgraph_symbol_new (self->callgraph,
|
||||||
@ -227,7 +227,7 @@ sysprof_callgraph_symbol_list_model_dispose (GObject *object)
|
|||||||
SysprofCallgraphSymbolListModel *self = (SysprofCallgraphSymbolListModel *)object;
|
SysprofCallgraphSymbolListModel *self = (SysprofCallgraphSymbolListModel *)object;
|
||||||
|
|
||||||
g_clear_pointer (&self->symbols, g_ptr_array_unref);
|
g_clear_pointer (&self->symbols, g_ptr_array_unref);
|
||||||
g_clear_object (&self->callgraph);
|
g_clear_weak_pointer (&self->callgraph);
|
||||||
|
|
||||||
G_OBJECT_CLASS (sysprof_callgraph_symbol_parent_class)->dispose (object);
|
G_OBJECT_CLASS (sysprof_callgraph_symbol_parent_class)->dispose (object);
|
||||||
}
|
}
|
||||||
@ -254,7 +254,7 @@ _sysprof_callgraph_symbol_list_model_new (SysprofCallgraph *callgraph,
|
|||||||
g_return_val_if_fail (SYSPROF_IS_CALLGRAPH (callgraph), NULL);
|
g_return_val_if_fail (SYSPROF_IS_CALLGRAPH (callgraph), NULL);
|
||||||
|
|
||||||
self = g_object_new (SYSPROF_TYPE_CALLGRAPH_SYMBOL_LIST_MODEL, NULL);
|
self = g_object_new (SYSPROF_TYPE_CALLGRAPH_SYMBOL_LIST_MODEL, NULL);
|
||||||
self->callgraph = g_object_ref (callgraph);
|
g_set_weak_pointer (&self->callgraph, callgraph);
|
||||||
|
|
||||||
if (symbols != NULL)
|
if (symbols != NULL)
|
||||||
self->symbols = g_ptr_array_ref (symbols);
|
self->symbols = g_ptr_array_ref (symbols);
|
||||||
|
|||||||
Reference in New Issue
Block a user