mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-29 06:51:10 +00:00
Plug some memory leaks in GL support
valgrind pointed these out.
This commit is contained in:
parent
0814cd9f8b
commit
c8d4eefa71
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user