[clutter] cogl/stage: Protect against multiple invocation of unrealize()



commit 598e7a4a7e2bbae8928690a4fc44f7771bef530c
Author: Emmanuele Bassi <ebassi linux intel com>
Date:   Fri Sep 9 13:52:55 2011 +0100

    cogl/stage: Protect against multiple invocation of unrealize()

 clutter/cogl/clutter-stage-cogl.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/clutter/cogl/clutter-stage-cogl.c b/clutter/cogl/clutter-stage-cogl.c
index 40416f3..abb68b7 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



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]