diff --git a/cogl/cogl-context.c b/cogl/cogl-context.c index c15e2db17..94ce2f14c 100644 --- a/cogl/cogl-context.c +++ b/cogl/cogl-context.c @@ -188,7 +188,16 @@ cogl_context_new (CoglDisplay *display, memset (context->winsys_features, 0, sizeof (context->winsys_features)); if (!display) - display = cogl_display_new (NULL, NULL); + { + CoglRenderer *renderer = cogl_renderer_new (); + if (!cogl_renderer_connect (renderer, error)) + { + g_free (context); + return NULL; + } + + display = cogl_display_new (renderer, NULL); + } else cogl_object_ref (display); diff --git a/cogl/cogl-display.c b/cogl/cogl-display.c index 4818bda6f..9ac1b6888 100644 --- a/cogl/cogl-display.c +++ b/cogl/cogl-display.c @@ -91,13 +91,7 @@ cogl_display_new (CoglRenderer *renderer, display->renderer = cogl_renderer_new (); if (!cogl_renderer_connect (display->renderer, &error)) - { - g_warning ("Failed to connect renderer: %s\n", error->message); - g_error_free (error); - g_object_unref (display->renderer); - g_slice_free (CoglDisplay, display); - return NULL; - } + g_error ("Failed to connect to renderer: %s\n", error->message); display->onscreen_template = onscreen_template; if (onscreen_template)