Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 17, 2007, 4:02:14 AM (17 years ago)
Author:
landauf
Message:

sorry, that was wrong (was just testing)

Location:
code/branches/FICN/src/orxonox/core
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/FICN/src/orxonox/core/Factory.cc

    r562 r563  
    3838namespace orxonox
    3939{
    40     Factory* Factory::pointer_s = 0;
    41 
    4240    /**
    4341        @returns the Identifier with a given name.
     
    105103    Factory* Factory::getFactoryPointer()
    106104    {
    107 //        static Factory theOneAndOnlyInstance = Factory();
    108 //        return &theOneAndOnlyInstance;
    109         if (!pointer_s)
    110             pointer_s = new Factory();
    111 
    112         return pointer_s;
     105      static Factory theOneAndOnlyInstance = Factory();
     106      return &theOneAndOnlyInstance;
    113107    }
    114108}
  • code/branches/FICN/src/orxonox/core/Factory.h

    r562 r563  
    3737            static void changeNetworkID(Identifier* identifier, const unsigned int oldID, const unsigned int newID);
    3838            static void createClassHierarchy();
     39
    3940            static Factory* getFactoryPointer();// avoid overriding pointer_s in the static intialisation process
    4041
     
    4344            Factory(const Factory& factory) {}      // don't copy
    4445            ~Factory() {}                           // don't delete
     46            static void checkPointer();
    4547
    46             static Factory* pointer_s;
    4748            std::map<std::string, Identifier*> identifierStringMap_;            //!< The map, mapping the name with the Identifier
    4849            std::map<unsigned int, Identifier*> identifierNetworkIDMap_;        //!< The map, mapping the network ID with the Identifier
Note: See TracChangeset for help on using the changeset viewer.