Author: maxun
Date: Wed Oct 17 20:37:07 2007
New Revision: 491

URL: http://svn.gna.org/viewcvs/cal3d?rev=491&view=rev
Log:
Fix for a memory leak:
I believe I have found a memory leak in CalCoreAnimation.cpp, or in the general 
use of the CalCoreAnimation class I guess I should say.

The CalLoader::loadCalCoreAnimation method uses new to create CalCoreTrack 
objects. The pointers to these are added to the CalCoreAnimationPtr. Users of 
the CalLoader class have no access to these CalCoreTrack objects, so when the 
CalCoreAnimation they do have access to is cleaned up, the tracks are left as 
leaked memory.

I have included the simplest fix I can think of for this, which is to call the 
CalCoreTrack::Destroy method on all tracks owned by the CalCoreAnimation in its 
destructor, and then to delete the tracks. This fixes the leak, and I can see 
no reasonable negative consequences for it given the normal usage patterns of 
the classes.

Modified:
    trunk/cal3d/src/cal3d/coreanimation.cpp


_______________________________________________
Cal3d-commits mailing list
[email protected]
https://mail.gna.org/listinfo/cal3d-commits

Reply via email to