[UFO-devel] memory leak
Status: Beta
Brought to you by:
schmidtjf
From: Andreas B. <b_...@gm...> - 2005-08-16 11:49:54
|
Hi line 210 of ubasicstyle.cpp: g->drawVertexArray(UGraphics::LineStrip, &array); where array is a ufo::UVertexArray. In the corresponding ufo::UGL_Graphics::drawVertexArray(): ugl_driver->glInterleavedArrays(GL_V3F, 0, buffer->getArray()); 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. CU Andi |