memory leak of visual info
Submitted by Andy Skinner
Assigned to mes..@..op.org
Description
This is a small leak (64 bytes) that happens as we allocate and free Visuals and FBConfigs in X11. Brian Paul mentioned that he wouldn't be sure it was a leak without study, so I figured I'd propose it here, just to track it.
XMesaCreateVisual allocates an XMesaVisual, then allocates an XVisualInfo and copies into it the XVisualInfo that was passed into the function, and stores the pointer in the XMesaVisua, as visinfo.
XMesaDestroyVisual calls free on both the XVisualInfo and the XMesaVisual. This is never called.
But destroy_visuals_on_display(), in fakeglx.c, only calls free on the XMesaVisual. Nothing frees the XVisualInfo that was copied into the pointer stored in XMesaVisual.
I don't know whether destroy_visuals_on_display() should call XMesaDestroyVisual(VisualTable[i]), or should just free(VisualTable[i]->visinfo).
Thanks andy