Page 1 of 1

[1.0.27] Memory leaks when playing a map

Posted: Sat Oct 27, 2007 2:26
by Carnevil
I ran into a couple memory leaks that would occur when playing maps. The first one has to do with the clipper not being freed after its use. I added this block to the end of gl_RenderView() to fix it:

Code: Select all

// [BC] We need to clear the clipper once again to prevent a memory leak. It's not a
// great solution, but it'll do for now.
clipper.Clear( );
The other one is happening as a result of this block in gl_PreprocessLevel():

Code: Select all

gl_ss_renderflags = new byte[numsubsectors];
memset(gl_ss_renderflags, 0, numsubsectors * sizeof(byte));
It didn't appear to be doing anything (except causing a leak), so I just commented it out. Everything seems to work fine despite doing that.

Posted: Sat Oct 27, 2007 9:38
by Graf Zahl
gl_ss_renderflags is indeed development garbage. The data wasn't used for anything whatsoever.

And the clipper was simply missing a proper destructor.