Bug 31128 - Memory leak on multiple OSMesaMakeCurrent calls
Summary: Memory leak on multiple OSMesaMakeCurrent calls
Alias: None
Product: Mesa
Classification: Unclassified
Component: Other (show other bugs)
Version: 7.8
Hardware: Other All
: medium normal
Assignee: mesa-dev
QA Contact:
Depends on:
Reported: 2010-10-26 01:48 UTC by dawhitehouse
Modified: 2010-10-30 09:11 UTC (History)
0 users

See Also:
i915 platform:
i915 features:

patch to avoid recreating renderbuffer (1.07 KB, patch)
2010-10-26 08:29 UTC, Brian Paul
Details | Splinter Review

Description dawhitehouse 2010-10-26 01:48:18 UTC
This is related to 29824. We're using version 7.8.2.

Our product makes a call to OSMesaCreateContextExt and then multiple calls to OSMesaMakeCurrent. The fix for 29824 fixed the assert we were getting but OSMesaMakeCurrent is leaking memory for every call after the first because it allocates a new renderbuffer.

At line 1331:

osmesa->rb = new_osmesa_renderbuffer(&osmesa->mesa, osmesa->format, type);

however in this situation osmesa->rb may already have been allocated.
Comment 1 Brian Paul 2010-10-26 08:29:49 UTC
Created attachment 39788 [details] [review]
patch to avoid recreating renderbuffer

Here's a quick patch to try.  I haven't tested it.
Comment 2 dawhitehouse 2010-10-27 02:52:32 UTC
Thanks very much. That seems to have done the trick.
Comment 3 Brian Paul 2010-10-30 09:11:54 UTC
OK, I've done additional testing and have committed the change: 9c2b4814d0b7dc67777099ea249c09bcf9ee46eb

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.