[Mesa-dev] visual leak?

Brian Paul brianp at vmware.com
Mon Apr 29 08:38:44 PDT 2013


On 04/26/2013 03:23 PM, Andy Skinner wrote:
> Hi. We are seeing a leak of things created in XMesaCreateVisual, as
> called from fakeglx.c. I don’t see anywhere that XMesaDestroyVisual is
> called. I see a free() in destroy_visuals_on_display, but I don’t know
> how often that is called. Are these visuals intended to be kept around?
>
> The visual is allocated in XMesaCreateVisual, from save_glx_visual,
> from choose_visual, from Fake_glXChooseFBConfig.
>
> It may be that the problem is that I’m not finding and reusing one in
> the list, but separate from that, I am curious why XMesaDestroyVisual
> isn’t called.
>
> Any thoughts?

There's no GLX function for explicitly destroying a visual so that's 
why XMesaDestroyVisual() isn't called.  Instead, we register an X 
display callback that's called when the X Display is closed which 
frees visuals and other things.

So, when you call XCloseDisplay, they should get freed.

-Brian


More information about the mesa-dev mailing list