change made was wrong (pointers in map are not deleted!)

This commit is contained in:
Robin Müller 2020-06-04 21:24:44 +02:00
parent d423c00115
commit e4944a067c
1 changed files with 5 additions and 3 deletions

View File

@ -9,7 +9,9 @@ ObjectManager::ObjectManager( void (*setProducer)() ):
ObjectManager::~ObjectManager() {
// Map is STL object and deletes its own pointers.
for (auto const& iter : objectList) {
delete iter.second;
}
}
ReturnValue_t ObjectManager::insert( object_id_t id, SystemObjectIF* object) {
@ -99,7 +101,7 @@ void ObjectManager::initialize() {
void ObjectManager::printList() {
std::map<object_id_t, SystemObjectIF*>::iterator it;
sif::debug << "ObjectManager: Object List contains:" << std::endl;
for (it = this->objectList.begin(); it != this->objectList.end(); it++) {
sif::debug << std::hex << it->first << " | " << it->second << std::endl;
for (auto const& it : objectList) {
sif::debug << std::hex << it.first << " | " << it.second << std::endl;
}
}