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.
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.
i25ffz/cal3d,i25ffz/cal3d,i25ffz/cal3d,i25ffz/cal3d