OSDN Git Service

xlib: fix memory leak of and remove vishandle from XMesaVisualInfo
authorJohn Sheu <sheu@google.com>
Fri, 1 Apr 2016 23:52:20 +0000 (16:52 -0700)
committerAlejandro Piñeiro <apinheiro@igalia.com>
Fri, 15 Apr 2016 05:45:28 +0000 (07:45 +0200)
commit781232e0ac48bf608757bbd270c593a90173f951
tree2b9ca9e4e11c50de00e0482220d1d915fb843001
parentfe9d8cd79e9380e29eb92f97903e8cb79d25371a
xlib: fix memory leak of and remove vishandle from XMesaVisualInfo

The vishandle member of XMesaVisualInfo is used to support the
comparison of XVisualInfo instances by pointer value, in
find_glx_visual().  The comparison however will always be false, as in
every case the comparison is made, the VisualInfo instance being
compared to is a new allocation passed in through a GLX API call.

In addition, the XVisualInfo instance pointed to by vishandle is itself
never freed, causing a memory leak.  Since vishandle is essentially
useless, we just remove it and thereby also fix the leak.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
src/mesa/drivers/x11/fakeglx.c
src/mesa/drivers/x11/xmesaP.h