diff options
author | Robert Bragg <robert@linux.intel.com> | 2012-11-08 19:20:45 +0000 |
---|---|---|
committer | Robert Bragg <robert@linux.intel.com> | 2012-11-26 23:33:06 +0000 |
commit | b8d1a1db482e1417979df9f88f92da47aa954bd0 (patch) | |
tree | 02f0803834a2c0dde85d7a415ef03259b9fadad4 | |
parent | f7735e141ad537a253b02afa2a8238f96340b978 (diff) | |
download | cogl-b8d1a1db482e1417979df9f88f92da47aa954bd0.tar.gz |
atlas: catch _create_texture errors
Previously we were passing NULL to
cogl_texture_2d_new_{from_bitmap,with_size} so if there was an error the
application would be aborted. This ensures we pass an internal CoglError
so errors can be caught and suppressed instead.
Reviewed-by: Neil Roberts <neil@linux.intel.com>
-rw-r--r-- | cogl/cogl-atlas.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/cogl/cogl-atlas.c b/cogl/cogl-atlas.c index 2fe85f09..855fb50a 100644 --- a/cogl/cogl-atlas.c +++ b/cogl/cogl-atlas.c @@ -279,6 +279,7 @@ _cogl_atlas_create_texture (CoglAtlas *atlas, int height) { CoglTexture2D *tex; + CoglError *ignore_error = NULL; _COGL_GET_CONTEXT (ctx, NULL); @@ -299,7 +300,7 @@ _cogl_atlas_create_texture (CoglAtlas *atlas, tex = cogl_texture_2d_new_from_bitmap (clear_bmp, atlas->texture_format, - NULL); + &ignore_error); cogl_object_unref (clear_bmp); g_free (clear_data); @@ -309,9 +310,12 @@ _cogl_atlas_create_texture (CoglAtlas *atlas, tex = cogl_texture_2d_new_with_size (ctx, width, height, atlas->texture_format, - NULL); + &ignore_error); } + if (!tex) + cogl_error_free (ignore_error); + return tex; } |