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
Any chance someone could look at this? We still get it reported as a leak, though it is in a large system and it would be hard to send a repro case. I admit we have't updated in a while, but the code is the same. If we could see this isn't a bug and we are using something wrong (our use of Mesa here is inside another 3rd party software library), that would also help. The difference between XMesaDestroyVisual (frees a single XMesaVisual and its XMesaVisualInfo) and destroy_visuals_on_display (only frees an array of XMesaVisuals but not their XMesaVisualInfos) seems clear. If destroy_visuals_on_display is not supposed to free the XVisualInfo, what is? The leaking object is said to be allocated in XGetVisualInfo, called from Fake_glXGetFBConfigs. Thanks.
-- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/mesa/mesa/issues/44.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.