diff --git a/vhdlpp/architec.cc b/vhdlpp/architec.cc index b3e5cfc4f..580b030a0 100644 --- a/vhdlpp/architec.cc +++ b/vhdlpp/architec.cc @@ -32,6 +32,8 @@ Architecture::Architecture(perm_string name, const ScopeBase&ref, Architecture::~Architecture() { + delete_all(statements_); + ScopeBase::cleanup(); } Architecture::Statement::Statement() @@ -75,6 +77,9 @@ ComponentInstantiation::ComponentInstantiation(perm_string i, perm_string c, ComponentInstantiation::~ComponentInstantiation() { + for(map::iterator it = port_map_.begin() + ; it != port_map_.end(); ++it) + delete it->second; } ProcessStatement::ProcessStatement(perm_string iname, diff --git a/vhdlpp/entity.cc b/vhdlpp/entity.cc index b9ccbff0a..de3846fb2 100644 --- a/vhdlpp/entity.cc +++ b/vhdlpp/entity.cc @@ -33,6 +33,9 @@ ComponentBase::ComponentBase(perm_string name) ComponentBase::~ComponentBase() { + for(std::vector::iterator it = ports_.begin() + ; it != ports_.end(); ++it) + delete *it; } void ComponentBase::set_interface(std::list*ports) @@ -60,6 +63,9 @@ Entity::Entity(perm_string name) Entity::~Entity() { + for(map::reverse_iterator it = arch_.rbegin() + ; it != arch_.rend(); ++it) + delete it->second; } Architecture* Entity::add_architecture(Architecture*that) diff --git a/vhdlpp/package.cc b/vhdlpp/package.cc index 936464569..f36c0b46f 100644 --- a/vhdlpp/package.cc +++ b/vhdlpp/package.cc @@ -26,4 +26,5 @@ Package::Package(perm_string n, const ScopeBase&ref) Package::~Package() { + ScopeBase::cleanup(); }