From 95a6bef6db17089d0eb82b4df005fa5f05b2f6e2 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Wed, 7 Aug 2019 14:56:42 +0300 Subject: [PATCH] Plug some memory leaks --- source/animation.cpp | 6 ++++-- source/instancearray.cpp | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) 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; -- 2.45.2