Re: [UFO-devel] memory leak
Status: Beta
Brought to you by:
schmidtjf
From: Johannes S. <sch...@us...> - 2005-08-16 12:19:15
|
On Tuesday 16 August 2005 13:50, Andreas Beckermann wrote: [...] > where "buffer" is the ufo::UVertexArray. So here we come to the important > part: In ufo::UVertexArray::getArray(): > float * ret = new float[getCount() * 3]; > [...] > return ret; > > Since glInterleavedArrays() does not free the pointer (and certainly > doesn't delete it), this is a memory leak. The getArray() pointer is never > freed anywhere. > (ubasicstyle.cpp, line 210 is only one example of this leak) > > To give you an idea of the size of this leak: valgrind reports about 2.7 MB > (!) definitely lost in a short session of a small test application. Ouch. Many thanks. I have committed a patch so that UVertexArray keeps track of the allocated memory and deletes it on destruction. Regards, Johannes |