osx: Add more checks to the redraw function

The redraw function might be called during destruction phase, when the
Stage state has not entirely been tore down. We need to be slightly more
resilient to that scenario.
This commit is contained in:
Emmanuele Bassi 2011-02-03 16:25:42 +00:00
parent d846f5fe6a
commit 9fa85ee9bf

View File

@ -192,14 +192,25 @@ clutter_backend_osx_ensure_context (ClutterBackend *backend,
}
static void
clutter_backend_osx_redraw (ClutterBackend *backend, ClutterStage *wrapper)
clutter_backend_osx_redraw (ClutterBackend *backend,
ClutterStage *wrapper)
{
ClutterStageWindow *impl = _clutter_stage_get_window (wrapper);
ClutterStageOSX *stage_osx = CLUTTER_STAGE_OSX (impl);
ClutterStageWindow *impl;
ClutterStageOSX *stage_osx;
if (CLUTTER_ACTOR_IN_DESTRUCTION (wrapper))
return;
impl = _clutter_stage_get_window (wrapper);
if (impl == NULL)
return;
stage_osx = CLUTTER_STAGE_OSX (impl);
CLUTTER_OSX_POOL_ALLOC();
[stage_osx->view setNeedsDisplay: YES];
if (stage_osx->view != NULL)
[stage_osx->view setNeedsDisplay: YES];
CLUTTER_OSX_POOL_RELEASE();
}