Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5821


Ignore:
Timestamp:
Sep 28, 2009, 3:56:30 PM (15 years ago)
Author:
rgrieder
Message:

Fixed 3 memory leaks (one of them was a true even a true one ;))

  • XMLPortObjectContainers as XMLPort event containers were not deleted in the identifier
  • EventContainers were not deleted in the BaseObject
  • ClassTreeMask clean() operation only erased redundant subnodes instead of deleting them as well
Location:
code/branches/core5/src/libraries/core
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core5/src/libraries/core/BaseObject.cc

    r5738 r5821  
    9999                it->first->removeEvent(this);
    100100
     101            for (std::map<std::string, EventContainer*>::const_iterator it = this->eventContainers_.begin(); it != this->eventContainers_.end(); ++it)
     102                delete it->second;
     103
    101104            if (this->functorSetMainState_)
    102105                delete this->functorSetMainState_;
     
    146149
    147150                XMLPortClassObjectContainer<BaseObject, BaseObject>* container = 0;
    148                 container = (XMLPortClassObjectContainer<BaseObject, BaseObject>*)(this->getIdentifier()->getXMLPortEventContainer(sectionname));
     151                container = static_cast<XMLPortClassObjectContainer<BaseObject, BaseObject>*>(this->getIdentifier()->getXMLPortEventContainer(sectionname));
    149152                if (!container)
    150153                {
  • code/branches/core5/src/libraries/core/ClassTreeMask.cc

    r5738 r5821  
    488488
    489489                // Remove the redundant subnode from the current node
     490                delete (*it);
    490491                node->subnodes_.erase(it++);
    491492            }
  • code/branches/core5/src/libraries/core/Identifier.cc

    r5796 r5821  
    8888        for (std::map<std::string, XMLPortObjectContainer*>::iterator it = this->xmlportObjectContainers_.begin(); it != this->xmlportObjectContainers_.end(); ++it)
    8989            delete (it->second);
     90        for (std::map<std::string, XMLPortObjectContainer*>::iterator it = this->xmlportEventContainers_.begin(); it != this->xmlportEventContainers_.end(); ++it)
     91            delete (it->second);
    9092    }
    9193
Note: See TracChangeset for help on using the changeset viewer.