From 79af8bf904b9ddb50b11ac231a2db517f1bdd55b Mon Sep 17 00:00:00 2001 From: Tim Redfern Date: Mon, 9 Sep 2013 19:17:53 +0100 Subject: in search of memory leaks --- rotord/src/rotor.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'rotord') diff --git a/rotord/src/rotor.h b/rotord/src/rotor.h index b2f50e6..a247c66 100755 --- a/rotord/src/rotor.h +++ b/rotord/src/rotor.h @@ -167,6 +167,9 @@ namespace Rotor { Node(){duplicate_inputs=false;}; virtual Node* clone(map &_settings)=0; //pure virtual virtual ~Node(){ + for (auto a: attributes) delete a.second; + for (auto p: parameters) delete p.second; + for (auto s: inputs) delete s; }; vector inputs; //simple node can have signal inputs, output depends on node type unordered_map parameters; //linked parameters can convert from settings to inputs @@ -234,7 +237,9 @@ namespace Rotor { }; class Image_node: public Node{ public: - virtual ~Image_node(){}; + virtual ~Image_node(){ + for (auto i: image_inputs) delete i; + }; vector image_inputs; //image node also has image inputs and outputs void create_image_input(const string &_title,const string &_desc,Node* _connect=nullptr) { image_inputs.push_back(new Image_input(_desc,_title,_connect)); -- cgit v1.2.3