X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/blast.git/blobdiff_plain/dd016ff4a3d4c5d4f90277637f86cdc31a7a91f8..d43174d0eb3d293b3bb5fbe76662241134e74d0d:/AbstractBlock.cpp diff --git a/AbstractBlock.cpp b/AbstractBlock.cpp index 6e9cc86..d316800 100644 --- a/AbstractBlock.cpp +++ b/AbstractBlock.cpp @@ -16,18 +16,8 @@ AbstractBlock::AbstractBlock(const QString& _name) { AbstractBlock::~AbstractBlock() { - foreach(AbstractInterface* iface, inputs) { - delete iface; - } - foreach(AbstractInterface* iface, outputs) { - delete iface; - } - foreach(AbstractInterface* iface, bidirs) { - delete iface; - } - inputs.clear(); - outputs.clear(); - bidirs.clear(); + removeAllInterfaces(); + foreach(BlockParameter* p, params) { delete p; } @@ -90,6 +80,23 @@ void AbstractBlock::removeInterface(AbstractInterface *inter) { delete inter; } +void AbstractBlock::removeAllInterfaces() { + + foreach(AbstractInterface* iface, inputs) { + delete iface; + } + foreach(AbstractInterface* iface, outputs) { + delete iface; + } + foreach(AbstractInterface* iface, bidirs) { + delete iface; + } + inputs.clear(); + outputs.clear(); + bidirs.clear(); + +} + void AbstractBlock::defineBlockParam(BlockParameter *param) { cout << "definition of param : " << param->getName().toStdString() << endl;