stage: Ensure that we don't pick during destruction

When destroying a ClutterStage we should just skip picking operations,
to avoid calling into a state that is being torn down.
This commit is contained in:
Emmanuele Bassi 2013-06-09 17:38:19 +01:00
parent d343cc6289
commit e1fe999db0

View File

@ -633,6 +633,9 @@ _clutter_stage_do_paint (ClutterStage *stage,
float clip_poly[8];
cairo_rectangle_int_t geom;
if (priv->impl == NULL)
return;
_clutter_stage_window_get_geometry (priv->impl, &geom);
if (clip)
@ -1463,9 +1466,15 @@ _clutter_stage_do_pick (ClutterStage *stage,
priv = stage->priv;
if (CLUTTER_ACTOR_IN_DESTRUCTION (stage))
return CLUTTER_ACTOR (stage);
if (G_UNLIKELY (clutter_pick_debug_flags & CLUTTER_DEBUG_NOP_PICKING))
return CLUTTER_ACTOR (stage);
if (G_UNLIKELY (priv->impl == NULL))
return CLUTTER_ACTOR (stage);
#ifdef CLUTTER_ENABLE_PROFILE
if (clutter_profile_flags & CLUTTER_PROFILE_PICKING_ONLY)
_clutter_profile_resume ();