summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Bragg <robert@linux.intel.com>2011-07-18 11:03:29 +0100
committerRobert Bragg <robert@linux.intel.com>2011-07-18 16:49:07 +0100
commit6d79657f76fb0df4c15b6a5ec63156b0f9596ac7 (patch)
treebb2347fa236ab903e12b8cef35b8cf62b2f1ac85
parent83db796744f5672b6c0831cdcfce0f0f6678dff5 (diff)
downloadcogl-6d79657f76fb0df4c15b6a5ec63156b0f9596ac7.tar.gz
egl: if texture_pixmap_x11_create fails free priv data
This makes sure the egl winsys frees the private egl_tex_pixmap state if in _cogl_winsys_texture_pixmap_x11_create if there is a failure to create an EGLImage. Reviewed-by: Neil Roberts <neil@linux.intel.com>
-rw-r--r--cogl/winsys/cogl-winsys-egl.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/cogl/winsys/cogl-winsys-egl.c b/cogl/winsys/cogl-winsys-egl.c
index 9664f834..c0763337 100644
--- a/cogl/winsys/cogl-winsys-egl.c
+++ b/cogl/winsys/cogl-winsys-egl.c
@@ -1582,7 +1582,10 @@ _cogl_winsys_texture_pixmap_x11_create (CoglTexturePixmapX11 *tex_pixmap)
(EGLClientBuffer)tex_pixmap->pixmap,
attribs);
if (egl_tex_pixmap->image == EGL_NO_IMAGE_KHR)
- return FALSE;
+ {
+ g_free (egl_tex_pixmap);
+ return FALSE;
+ }
texture_format = (tex_pixmap->depth >= 32 ?
COGL_PIXEL_FORMAT_RGBA_8888_PRE :