stage: Add more checks on the stage window retrieval

During destruction, the StageWindow implementation associated to a Stage
might be NULL. We need to add more checks for a) the IN_DESTRUCTION flag
being set and b) the StageWindow pointer being NULL. Otherwise, we will
get warnings during the destruction of the Stage.
This commit is contained in:
Emmanuele Bassi 2010-09-30 10:27:10 +01:00
parent 52c4d6fa0c
commit f090c3ea49

View File

@ -225,11 +225,14 @@ clutter_stage_get_preferred_height (ClutterActor *self,
*natural_height_p = geom.height;
}
static void
static inline void
queue_full_redraw (ClutterStage *stage)
{
ClutterStageWindow *stage_window;
if (CLUTTER_ACTOR_IN_DESTRUCTION (stage))
return;
clutter_actor_queue_redraw (CLUTTER_ACTOR (stage));
/* Just calling clutter_actor_queue_redraw will typically only
@ -237,6 +240,9 @@ queue_full_redraw (ClutterStage *stage)
* in this case we really need to ensure that the full stage is
* redrawn so we add a NULL redraw clip to the stage window. */
stage_window = _clutter_stage_get_window (stage);
if (stage_window == NULL)
return;
_clutter_stage_window_add_redraw_clip (stage_window, NULL);
}
@ -842,10 +848,16 @@ clutter_stage_real_queue_redraw (ClutterActor *actor,
CoglMatrix modelview;
ClutterActorBox bounding_box;
if (CLUTTER_ACTOR_IN_DESTRUCTION (actor))
return;
/* If the backend can't do anything with redraw clips (e.g. it already knows
* it needs to redraw everything anyway) then don't spend time transforming
* any clip volume into stage coordinates... */
stage_window = _clutter_stage_get_window (stage);
if (stage_window == NULL)
return;
if (_clutter_stage_window_ignoring_redraw_clips (stage_window))
return;