[gtk+] Plug some memory leaks in GL support
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] Plug some memory leaks in GL support
- Date: Tue, 28 Oct 2014 20:08:08 +0000 (UTC)
commit c8d4eefa719108c9ead491f93c557fa0c8f14c98
Author: Matthias Clasen <mclasen redhat com>
Date: Tue Oct 28 16:06:42 2014 -0400
Plug some memory leaks in GL support
valgrind pointed these out.
gdk/x11/gdkglcontext-x11.c | 12 +++++++++++-
1 files changed, 11 insertions(+), 1 deletions(-)
---
diff --git a/gdk/x11/gdkglcontext-x11.c b/gdk/x11/gdkglcontext-x11.c
index 061b15a..12a6b8a 100644
--- a/gdk/x11/gdkglcontext-x11.c
+++ b/gdk/x11/gdkglcontext-x11.c
@@ -286,6 +286,7 @@ glx_pixmap_get (cairo_surface_t *surface)
GLXFBConfig *fbconfigs;
int nfbconfigs;
XVisualInfo *visinfo;
+ VisualID visualid;
int i, value;
gboolean y_inverted;
gboolean with_alpha;
@@ -304,7 +305,13 @@ glx_pixmap_get (cairo_surface_t *surface)
for (i = 0; i < nfbconfigs; i++)
{
visinfo = glXGetVisualFromFBConfig (display, fbconfigs[i]);
- if (!visinfo || visinfo->visualid != XVisualIDFromVisual (visual))
+ if (!visinfo)
+ continue;
+
+ visualid = visinfo->visualid;
+ XFree (visinfo);
+
+ if (visualid != XVisualIDFromVisual (visual))
continue;
glXGetFBConfigAttrib (display, fbconfigs[i], GLX_DRAWABLE_TYPE, &value);
@@ -338,6 +345,7 @@ glx_pixmap_get (cairo_surface_t *surface)
&value);
if (!value)
continue;
+
format = GLX_TEXTURE_FORMAT_RGBA_EXT;
}
@@ -350,6 +358,8 @@ glx_pixmap_get (cairo_surface_t *surface)
break;
}
+ XFree (fbconfigs);
+
if (i == nfbconfigs)
return NULL;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]