From 919efb5a6fb058e8f4200bc6ad6682edf894fa18 Mon Sep 17 00:00:00 2001 From: Neil Roberts Date: Wed, 2 Jul 2008 16:15:30 +0000 Subject: [PATCH] * clutter/clutter-actor.c (clutter_actor_get_abs_allocation_vertices): The initialization of the local stage pointer got moved away in revision 3081 so it was crashing if the function is called before the layout is run. --- ChangeLog | 7 +++++++ clutter/clutter-actor.c | 13 +++++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0faf1cad9..9265caf8e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-07-02 Neil Roberts + + * clutter/clutter-actor.c + (clutter_actor_get_abs_allocation_vertices): The initialization of + the local stage pointer got moved away in revision 3081 so it was + crashing if the function is called before the layout is run. + 2008-07-02 Emmanuele Bassi * clutter/clutter-label.c: diff --git a/clutter/clutter-actor.c b/clutter/clutter-actor.c index ad102568b..66062123f 100644 --- a/clutter/clutter-actor.c +++ b/clutter/clutter-actor.c @@ -1265,7 +1265,6 @@ clutter_actor_get_abs_allocation_vertices (ClutterActor *self, ClutterVertex verts[4]) { ClutterActorPrivate *priv; - ClutterActor *stage; g_return_if_fail (CLUTTER_IS_ACTOR (self)); @@ -1276,7 +1275,17 @@ clutter_actor_get_abs_allocation_vertices (ClutterActor *self, * clutter_actor_transform_and_project_box() */ if (priv->needs_allocation) - _clutter_stage_maybe_relayout (stage); + { + ClutterActor *stage = clutter_actor_get_stage (self); + + /* FIXME: if were not yet added to a stage, its probably unsafe to + * return default - idealy the func should fail. + */ + if (stage == NULL) + stage = clutter_stage_get_default (); + + _clutter_stage_maybe_relayout (stage); + } clutter_actor_transform_and_project_box (self, &self->priv->allocation,