refresh(); The on"> Memory Leak in tstsshapeinstance.cc: 1131 | Torque Game Engine | Forums | Community | GarageGames.com

Game Development Community

Memory Leak in ts\tsshapeinstance.cc: 1131

by Duncan Gray · in Torque Game Engine · 01/25/2006 (10:09 pm) · 1 replies

In TSShapeInstance::SetUpFog

At line 1130
if (!smRenderData.fogHandle)
      [b]smRenderData.fogHandle = new TextureHandle("fog_texture", smRenderData.fogBitmap);[/b]
   else
      if (refresh)
         smRenderData.fogHandle->refresh();

The only place where that smRenderData.fogHandle gets deleted is in:
void TSShapeInstance::destroy()
{
   delete smRenderData.fogHandle;
}

I loaded a mission then put a breakpoint on the delete spot, then exited the mission back to the main menu, but the breakpoint never gets triggered until you exit the entire game, not the mission.

I tried moving it to the TSShapeInstance destructor but then you get errors in void TextureHandle::unlock()

#1
01/26/2006 (8:51 pm)
This is a very breif look, but it seems like it's only going to create that texture once during the apps lifetime. So it's not really a leak. I might be wrong if smRenderData.fogHandle gets assigned to nil after the mission exits or something. If you want to fix your crash issue, you might want to try setting smRenderData.fogHandle to NULL after deleting it to avoid multiple delete issues.

Hope that helps!

Brian "bzztbomb" Richardson -- [url="http://knowhere.net/"]Knowhere Studios[/url]