Fix problems on destruction

StScrollBar: Be robust against being disposed multiple times,
  which can happen, and in fact, normally happens when destroying
  the parent.

StScrollView: Implement remove() for the hscroll and vscroll members,
  and just destroy them in dispose() and let them be removed.
  unparent the shadows, instead of just unref'ing them directly.

https://bugzilla.gnome.org/show_bug.cgi?id=611203
This commit is contained in:
Owen W. Taylor
2010-02-26 12:48:07 -05:00
parent ed3e287d91
commit 6423cbfc92
2 changed files with 41 additions and 27 deletions

View File

@ -188,14 +188,23 @@ st_scroll_bar_dispose (GObject *gobject)
priv->handle = NULL;
}
clutter_actor_unparent (priv->bw_stepper);
priv->bw_stepper = NULL;
if (priv->bw_stepper)
{
clutter_actor_unparent (priv->bw_stepper);
priv->bw_stepper = NULL;
}
clutter_actor_unparent (priv->fw_stepper);
priv->fw_stepper = NULL;
if (priv->fw_stepper)
{
clutter_actor_unparent (priv->fw_stepper);
priv->fw_stepper = NULL;
}
clutter_actor_unparent (priv->trough);
priv->trough = NULL;
if (priv->trough)
{
clutter_actor_unparent (priv->trough);
priv->trough = NULL;
}
G_OBJECT_CLASS (st_scroll_bar_parent_class)->dispose (gobject);
}