- 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:
parent
93fefe49e0
commit
e31aa3bf9c
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue