mirror of
https://gitlab.gnome.org/GNOME/calls.git
synced 2025-01-07 12:25:31 +00:00
call-holder,call-selector-item: Dispose mutual references properly
This commit is contained in:
parent
e88156380e
commit
224ab410d0
2 changed files with 16 additions and 3 deletions
|
@ -137,10 +137,17 @@ dispose (GObject *object)
|
||||||
GObjectClass *parent_class = g_type_class_peek (G_TYPE_OBJECT);
|
GObjectClass *parent_class = g_type_class_peek (G_TYPE_OBJECT);
|
||||||
CallsCallHolder *self = CALLS_CALL_HOLDER (object);
|
CallsCallHolder *self = CALLS_CALL_HOLDER (object);
|
||||||
|
|
||||||
g_clear_object (&self->selector_item);
|
// Mutual reference
|
||||||
|
if (self->selector_item)
|
||||||
|
{
|
||||||
|
GObject *selector_item = G_OBJECT (self->selector_item);
|
||||||
|
self->selector_item = NULL;
|
||||||
|
g_object_unref (selector_item);
|
||||||
|
}
|
||||||
|
|
||||||
g_clear_object (&self->display);
|
g_clear_object (&self->display);
|
||||||
g_clear_object (&self->data);
|
g_clear_object (&self->data);
|
||||||
|
|
||||||
parent_class->dispose (object);
|
parent_class->dispose (object);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -191,7 +191,13 @@ dispose (GObject *object)
|
||||||
GObjectClass *parent_class = g_type_class_peek (GTK_TYPE_EVENT_BOX);
|
GObjectClass *parent_class = g_type_class_peek (GTK_TYPE_EVENT_BOX);
|
||||||
CallsCallSelectorItem *self = CALLS_CALL_SELECTOR_ITEM (object);
|
CallsCallSelectorItem *self = CALLS_CALL_SELECTOR_ITEM (object);
|
||||||
|
|
||||||
g_clear_object (&self->holder);
|
// Mutual reference
|
||||||
|
if (self->holder)
|
||||||
|
{
|
||||||
|
GObject *holder = G_OBJECT (self->holder);
|
||||||
|
self->holder = NULL;
|
||||||
|
g_object_unref (holder);
|
||||||
|
}
|
||||||
|
|
||||||
parent_class->dispose (object);
|
parent_class->dispose (object);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue