]> git.tdb.fi Git - libs/gl.git/commitdiff
Plug some memory leaks
authorMikko Rasa <tdb@tdb.fi>
Wed, 7 Aug 2019 11:56:42 +0000 (14:56 +0300)
committerMikko Rasa <tdb@tdb.fi>
Wed, 7 Aug 2019 11:56:42 +0000 (14:56 +0300)
source/animation.cpp
source/instancearray.cpp

index 37f583d5ec53b43324e67f7fcd1237a25bbefa80..b1ae1157fac6eeb8bbc64c5431845eef04c4f5a0 100644 (file)
@@ -18,9 +18,11 @@ Animation::Animation():
        looping(false)
 { }
 
-// Avoid synthesizing ~RefPtr in files including animation.h
 Animation::~Animation()
-{ }
+{
+       for(vector<Curve *>::iterator i=curves.begin(); i!=curves.end(); ++i)
+               delete *i;
+}
 
 void Animation::set_armature(const Armature &a)
 {
index 29b59f09d9648e8f2474397852f6643910bef1c1..5c6ab423bb8981326416b718e078cd51cceac12e 100644 (file)
@@ -62,6 +62,8 @@ InstanceArray::InstanceArray(const Object &o):
 
 InstanceArray::~InstanceArray()
 {
+       for(std::vector<ObjectInstance *>::iterator i=instances.begin(); i!=instances.end(); ++i)
+               delete *i;
        delete vtx_setup;
        delete instance_data;
        delete instance_buffer;