Commit e2578177 authored by Adrien Plazas's avatar Adrien Plazas

action-row: Drop pointers to internals on destruction

This avoids crashes when trying to access pointers to already dropped
widgets.

Fixes #69
parent 154ca50a
......@@ -198,9 +198,14 @@ static void
hdy_action_row_destroy (GtkWidget *widget)
{
HdyActionRow *self = HDY_ACTION_ROW (widget);
HdyActionRowPrivate *priv = hdy_action_row_get_instance_private (self);
hdy_action_row_set_activatable_widget (self, NULL);
priv->prefixes = NULL;
priv->header = NULL;
priv->box = NULL;
GTK_WIDGET_CLASS (hdy_action_row_parent_class)->destroy (widget);
}
......@@ -260,9 +265,12 @@ hdy_action_row_forall (GtkContainer *container,
data.callback = callback;
data.callback_data = callback_data;
GTK_CONTAINER_GET_CLASS (priv->prefixes)->forall (GTK_CONTAINER (priv->prefixes), include_internals, for_non_internal_child, &data);
GTK_CONTAINER_GET_CLASS (priv->header)->forall (GTK_CONTAINER (priv->header), include_internals, for_non_internal_child, &data);
GTK_CONTAINER_GET_CLASS (priv->box)->forall (GTK_CONTAINER (priv->box), include_internals, for_non_internal_child, &data);
if (priv->prefixes)
GTK_CONTAINER_GET_CLASS (priv->prefixes)->forall (GTK_CONTAINER (priv->prefixes), include_internals, for_non_internal_child, &data);
if (priv->header)
GTK_CONTAINER_GET_CLASS (priv->header)->forall (GTK_CONTAINER (priv->header), include_internals, for_non_internal_child, &data);
if (priv->box)
GTK_CONTAINER_GET_CLASS (priv->box)->forall (GTK_CONTAINER (priv->box), include_internals, for_non_internal_child, &data);
}
static void
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment