diff options
| author | Tim Redfern <tim@eclectronics.org> | 2013-09-09 19:17:53 +0100 |
|---|---|---|
| committer | Tim Redfern <tim@eclectronics.org> | 2013-09-09 19:17:53 +0100 |
| commit | 79af8bf904b9ddb50b11ac231a2db517f1bdd55b (patch) | |
| tree | 0f606b61efa0335f0ab9ec2f5ff4e66aee5f0a11 /rotord/src/rotor.h | |
| parent | f0a817e8ac52a22491236cbf83d741c6e92f58d1 (diff) | |
in search of memory leaks
Diffstat (limited to 'rotord/src/rotor.h')
| -rwxr-xr-x | rotord/src/rotor.h | 7 |
1 files changed, 6 insertions, 1 deletions
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<string,string> &_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<Signal_input*> inputs; //simple node can have signal inputs, output depends on node type unordered_map<string,Parameter*> 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_input*> 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)); |
