Commit 7f085472 authored by John Sheu's avatar John Sheu Committed by Brian Paul

xlib: fix memory leak on Display close

The XMesaVisual instances freed in the visuals table on display close
are being freed with a free() call, instead of XMesaDestroyVisual(),
causing a memory leak.
Signed-off-by: default avatarJohn Sheu <>
Reviewed-by: default avatarBrian Paul <>
parent d04bb14d
......@@ -794,7 +794,7 @@ destroy_visuals_on_display(Display *dpy)
if (VisualTable[i]->display == dpy) {
/* remove this visual */
int j;
for (j = i; j < NumVisuals - 1; j++)
VisualTable[j] = VisualTable[j + 1];
......@@ -856,6 +856,7 @@ XMesaVisual XMesaCreateVisual( XMesaDisplay *display,
accum_red_size, accum_green_size,
accum_blue_size, accum_alpha_size,
0)) {
return NULL;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment