From 598e7a4a7e2bbae8928690a4fc44f7771bef530c Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Fri, 9 Sep 2011 13:52:55 +0100 Subject: [PATCH] cogl/stage: Protect against multiple invocation of unrealize() --- clutter/cogl/clutter-stage-cogl.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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