stage: Ignore redraws on destroyed stages
authorEmmanuele Bassi <ebassi@linux.intel.com>
Tue, 20 Jul 2010 13:39:43 +0000 (14:39 +0100)
committerEmmanuele Bassi <ebassi@linux.intel.com>
Tue, 20 Jul 2010 13:39:43 +0000 (14:39 +0100)
We might get requests to redraw even during destruction; we should
ignore them and do some NULL checks instead of blindly invoking
functions.

clutter/clutter-stage.c

index 34f06c6..41ef2fa 100644 (file)
@@ -771,6 +771,13 @@ gboolean
 _clutter_stage_has_full_redraw_queued (ClutterStage *stage)
 {
   ClutterStageWindow *stage_window = _clutter_stage_get_window (stage);
+  gboolean in_destruction;
+
+  in_destruction =
+    ((CLUTTER_PRIVATE_FLAGS (stage) & CLUTTER_ACTOR_IN_DESTRUCTION) != FALSE);
+
+  if (in_destruction || stage_window == NULL)
+    return FALSE;
 
   if (stage->priv->redraw_pending &&
       !_clutter_stage_window_has_redraw_clips (stage_window))