[Mesa-dev] visual leak?

Andy Skinner Andy.Skinner at mathworks.com
Mon Apr 29 10:04:29 PDT 2013


Thanks.  I realized today that newer Mesa registers the display with that callback for choosing FBConfig, but our older version only does it for Visual.  So it isn't getting freed when we close the display.

Do you think the register_with_display() call can be put into Fake_glXChooseFBConfig() on its own?  We'd like to update Mesa, but it may not be a good time in our release cycle.

Also, destroy_visuals_on_display calls free, but XMesaDestroyVisual can also call free on v->visinfo.  Should destroy_visuals_on_display call XMesaDestroyVisual, or do both free()s?

thanks
andy

-----Original Message-----
From: Brian Paul [mailto:brianp at vmware.com] 
Sent: Monday, April 29, 2013 11:39 AM
To: Andy Skinner
Cc: mesa-dev at lists.freedesktop.org
Subject: Re: [Mesa-dev] visual leak?

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