[clutter] stage-cogl: Abort realize() if there's no CoglContext



commit 83caeaae9b4e3b372c943573151bd612f15fe17f
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Tue Mar 17 13:47:08 2015 +0000

    stage-cogl: Abort realize() if there's no CoglContext
    
    There's no point in trying to go ahead if we don't have a context to
    create the CoglOnscreen framebuffer, and Cogl will crash anyway if we
    pass NULL to the constructor.

 clutter/cogl/clutter-stage-cogl.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/clutter/cogl/clutter-stage-cogl.c b/clutter/cogl/clutter-stage-cogl.c
index 5a8c3bd..710374e 100644
--- a/clutter/cogl/clutter-stage-cogl.c
+++ b/clutter/cogl/clutter-stage-cogl.c
@@ -135,6 +135,12 @@ clutter_stage_cogl_realize (ClutterStageWindow *stage_window)
 
   backend = clutter_get_default_backend ();
 
+  if (backend->cogl_context == NULL)
+    {
+      g_warning ("Failed to realize stage: missing Cogl context");
+      return FALSE;
+    }
+
   if (stage_cogl->onscreen == NULL)
     {
       stage_cogl->onscreen = cogl_onscreen_new (backend->cogl_context,


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