Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9602 for code


Ignore:
Timestamp:
Mar 29, 2013, 10:37:15 PM (12 years ago)
Author:
landauf
Message:

delete factory before setting a new one (mostly for unit tests)

Location:
code/branches/core6/src/libraries/core
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core6/src/libraries/core/class/Identifier.cc

    r9593 r9602  
    165165    }
    166166
     167    void Identifier::setFactory(Factory* factory)
     168    {
     169        if (this->factory_)
     170            delete this->factory_;
     171
     172        this->factory_ = factory;
     173    }
     174
     175
    167176    /**
    168177        @brief Creates an object of the type the Identifier belongs to.
  • code/branches/core6/src/libraries/core/class/Identifier.h

    r9597 r9602  
    131131
    132132            /// Sets the Factory.
    133             inline void addFactory(Factory* factory) { this->factory_ = factory; }
     133            void setFactory(Factory* factory);
    134134            /// Returns true if the Identifier has a Factory.
    135135            inline bool hasFactory() const { return (this->factory_ != 0); }
  • code/branches/core6/src/libraries/core/object/ClassFactory.h

    r9563 r9602  
    7474            {
    7575                orxout(verbose, context::misc::factory) << "Create entry for " << name << " in Factory." << endl;
    76                 ClassIdentifier<T>::getIdentifier(name)->addFactory(this);
     76                ClassIdentifier<T>::getIdentifier(name)->setFactory(this);
    7777                ClassIdentifier<T>::getIdentifier()->setLoadable(bLoadable);
    7878            }
Note: See TracChangeset for help on using the changeset viewer.