st-bin: Destroy child in ClutterActor:destroy vfunc
According to Clutter documentation, "[…] actors implementing the
ClutterContainer interface should override the default implementation
of the class handler of this signal and call clutter_actor_destroy()
on their children."
StBin was doing that in GObject:dispose() instead. Move the child
destruction to a new ClutterActor:destroy() vfunc override.
(cherry picked from commit b719744e75
)
This commit is contained in:
parent
1b28cdfbf4
commit
24cdcc56da
@ -177,15 +177,15 @@ st_bin_get_preferred_height (ClutterActor *self,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
st_bin_dispose (GObject *gobject)
|
st_bin_destroy (ClutterActor *actor)
|
||||||
{
|
{
|
||||||
StBinPrivate *priv = st_bin_get_instance_private (ST_BIN (gobject));
|
StBinPrivate *priv = st_bin_get_instance_private (ST_BIN (actor));
|
||||||
|
|
||||||
if (priv->child)
|
if (priv->child)
|
||||||
clutter_actor_destroy (priv->child);
|
clutter_actor_destroy (priv->child);
|
||||||
g_assert (priv->child == NULL);
|
g_assert (priv->child == NULL);
|
||||||
|
|
||||||
G_OBJECT_CLASS (st_bin_parent_class)->dispose (gobject);
|
CLUTTER_ACTOR_CLASS (st_bin_parent_class)->destroy (actor);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -315,11 +315,11 @@ st_bin_class_init (StBinClass *klass)
|
|||||||
|
|
||||||
gobject_class->set_property = st_bin_set_property;
|
gobject_class->set_property = st_bin_set_property;
|
||||||
gobject_class->get_property = st_bin_get_property;
|
gobject_class->get_property = st_bin_get_property;
|
||||||
gobject_class->dispose = st_bin_dispose;
|
|
||||||
|
|
||||||
actor_class->get_preferred_width = st_bin_get_preferred_width;
|
actor_class->get_preferred_width = st_bin_get_preferred_width;
|
||||||
actor_class->get_preferred_height = st_bin_get_preferred_height;
|
actor_class->get_preferred_height = st_bin_get_preferred_height;
|
||||||
actor_class->allocate = st_bin_allocate;
|
actor_class->allocate = st_bin_allocate;
|
||||||
|
actor_class->destroy = st_bin_destroy;
|
||||||
|
|
||||||
widget_class->popup_menu = st_bin_popup_menu;
|
widget_class->popup_menu = st_bin_popup_menu;
|
||||||
widget_class->navigate_focus = st_bin_navigate_focus;
|
widget_class->navigate_focus = st_bin_navigate_focus;
|
||||||
|
Loading…
Reference in New Issue
Block a user