From: Mikko Rasa Date: Wed, 7 Aug 2019 11:56:42 +0000 (+0300) Subject: Plug some memory leaks X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=95a6bef6db17089d0eb82b4df005fa5f05b2f6e2;p=libs%2Fgl.git Plug some memory leaks --- diff --git a/source/animation.cpp b/source/animation.cpp index 37f583d5..b1ae1157 100644 --- a/source/animation.cpp +++ b/source/animation.cpp @@ -18,9 +18,11 @@ Animation::Animation(): looping(false) { } -// Avoid synthesizing ~RefPtr in files including animation.h Animation::~Animation() -{ } +{ + for(vector::iterator i=curves.begin(); i!=curves.end(); ++i) + delete *i; +} void Animation::set_armature(const Armature &a) { diff --git a/source/instancearray.cpp b/source/instancearray.cpp index 29b59f09..5c6ab423 100644 --- a/source/instancearray.cpp +++ b/source/instancearray.cpp @@ -62,6 +62,8 @@ InstanceArray::InstanceArray(const Object &o): InstanceArray::~InstanceArray() { + for(std::vector::iterator i=instances.begin(); i!=instances.end(); ++i) + delete *i; delete vtx_setup; delete instance_data; delete instance_buffer;