- Add code for freeing memory also in destructor

git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@1030 3ecf2c5c-341e-0410-92b4-d18e462d057c
This commit is contained in:
tchernobog 2006-09-06 18:35:51 +00:00
parent 93fefe49e0
commit e31aa3bf9c
1 changed files with 9 additions and 0 deletions

View File

@ -329,6 +329,15 @@ HoltWidget::HoltWidget(Simulation& simulation)
HoltWidget::~HoltWidget()
{
// Free allocated memory
const HoltResources& const_holt_resources = _holt_resources;
for(Iseq<HoltResources::const_iterator> it = iseq(const_holt_resources); it; ++it)
delete it->second;
for_each_in(_holt_schedulables, memory::deletor<HoltSchedulable>());
for_each_in(_holt_requests, memory::deletor<HoltRequest>());
// Unregister this HistoryObserver:
_simulation->get_history().detach(*this);