[cogl] egl: if texture_pixmap_x11_create fails free priv data



commit 6d79657f76fb0df4c15b6a5ec63156b0f9596ac7
Author: Robert Bragg <robert linux intel com>
Date:   Mon Jul 18 11:03:29 2011 +0100

    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>

 cogl/winsys/cogl-winsys-egl.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/cogl/winsys/cogl-winsys-egl.c b/cogl/winsys/cogl-winsys-egl.c
index 9664f83..c076333 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 :



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]