diff --git a/clutter/cogl/clutter-stage-cogl.c b/clutter/cogl/clutter-stage-cogl.c index 40416f3f4..abb68b786 100644 --- a/clutter/cogl/clutter-stage-cogl.c +++ b/clutter/cogl/clutter-stage-cogl.c @@ -71,8 +71,11 @@ clutter_stage_cogl_unrealize (ClutterStageWindow *stage_window) clutter_stage_window_parent_iface->unrealize (stage_window); #endif - cogl_object_unref (stage_cogl->onscreen); - stage_cogl->onscreen = NULL; + if (stage_cogl->onscreen != NULL) + { + cogl_object_unref (stage_cogl->onscreen); + stage_cogl->onscreen = NULL; + } } static void