Robert Bragg cc4c578887 fix cogl_context_new crash if fail to connect renderer
If a NULL display is passed to cogl_context_new() then it has to
implicitly create a CoglRenderer and CoglDisplay and propagate any
resulting errors back to the user. Previously the implementation relied
on passing a NULL renderer to cogl_display_new() as the means for
implicitly connecting to a renderer. The problem with this though is
that cogl_display_new() isn't designed to ever return NULL but if it
failed to connect to a renderer automatically it would do and then
cogl_context_new would pass NULL to cogl_display_setup() leading to a
crash.

This patch changes the implementation of cogl_context_new() to now
explicitly create a CoglRenderer and connect to it if a NULL display is
given. This way we can easily propagate any errors. In addition
cogl_display_new has been changed to abort if it fails to implicitly
connect to a renderer due to a NULL renderer argument.

An application needing to gracefully handle problems connecting to a
renderer at runtime should manually instantiate and connect a renderer
passing a GError argument to cogl_renderer_connect.

Reviewed-by: Neil Roberts <neil@linux.intel.com>
2012-04-11 12:26:52 +01:00
..
2012-04-05 13:47:36 +01:00
2012-03-23 13:51:08 +00:00
2010-06-01 12:08:18 +01:00
2012-04-05 13:47:36 +01:00
2012-02-14 20:42:10 +00:00
2012-02-14 20:42:10 +00:00
2011-11-01 12:03:02 +00:00
2012-02-15 14:57:59 +00:00
2012-04-05 13:47:36 +01:00
2012-03-23 13:51:08 +00:00
2012-03-20 13:17:07 +00:00
2012-03-14 12:19:56 +00:00
2012-04-04 17:02:23 +01:00
2012-03-21 22:15:34 +08:00
2011-08-12 15:28:42 +01:00