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.
This commit is contained in:
Emmanuele Bassi 2015-03-17 13:47:08 +00:00
parent 6355b5ab78
commit 83caeaae9b

View File

@ -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,