diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c index 3dab1b643f1..156a5745f4d 100644 --- a/dlls/winex11.drv/opengl.c +++ b/dlls/winex11.drv/opengl.c @@ -814,9 +814,10 @@ static int get_render_type_from_fbconfig(Display *display, GLXFBConfig fbconfig) static BOOL init_formats(Display *display, int screen, Visual *visual) { - int fmt_id, tmp_vis_id, tmp_fmt_id, nCfgs, i; + int fmt_id, tmp_fmt_id, nCfgs, i; GLXFBConfig* cfgs; GLXFBConfig fbconfig = NULL; + XVisualInfo *visinfo; VisualID visualid = XVisualIDFromVisual(visual); int nOffscreenFormats = 0; @@ -833,17 +834,16 @@ static BOOL init_formats(Display *display, int screen, Visual *visual) /* Count the number of offscreen formats to determine the size for our pixelformat list */ for(i=0; ivisualid == visualid) { pglXGetFBConfigAttrib(display, cfgs[i], GLX_FBCONFIG_ID, &fmt_id); fbconfig = cfgs[i]; - } - - /* We have found an offscreen rendering format :) */ - if(tmp_vis_id == 0) { - nOffscreenFormats++; + XFree(visinfo); } } TRACE("Number of offscreen formats: %d\n", nOffscreenFormats); @@ -860,11 +860,11 @@ static BOOL init_formats(Display *display, int screen, Visual *visual) /* Fill the list with offscreen formats */ for(i=0; i