Game Development Community

Possible memory leak in shadow code?

by Skylar Kelty · in Torque Game Engine · 07/01/2006 (2:35 am) · 3 replies

Apparently there is a memory leak in sgshadow.cc
Quote:Leak in c:\sphyxgames\dawnofmen\dawnofmen 0.9\engine\synapsegaming\contentpacks\lightingpack\sgshadow.cc: 135 264 (523719)
(from memory leak finder log)
line 135:
shadow = new Shadow;
Are the shadows ever deleted? if not where should they be deleted?

#1
07/02/2006 (12:04 am)
Yes, good catch. :) Thats a known issue that will be resolved in the next release (available when TGE 1.4.x is released).

For performance reasons those shadows are cached, but unfortunately the cleanup code was omitted. If you need to take care of this now, you can delete the shadows from the shadow vector in the sgSceneObject destructor.

Luckily under most conditions the leak is slow and doesn't affect the game.
#2
07/02/2006 (11:53 am)
If that report was right that means I have another 780 to deal with :(
#3
07/02/2006 (11:58 am)
Yeah if you are using the same leak detection system I think you are I think you need to watch in the directions for use, some of those are normal memory allocations.