Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 4, 2009, 12:03:14 AM (15 years ago)
Author:
rgrieder
Message:

Fixed a possible issue in Game and a build system bug with PCH.

File:
1 edited

Legend:

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

    r5855 r5868  
    117117    Game::Game(const std::string& cmdLine)
    118118        // Destroy factories before the Core!
    119         : gsFactoryDestroyer_(Game::GameStateFactory::factories_s, &std::map<std::string, shared_ptr<GameStateFactory> >::clear)
     119        : gsFactoryDestroyer_(Game::GameStateFactory::getFactories(), &std::map<std::string, shared_ptr<GameStateFactory> >::clear)
    120120    {
    121121        this->bAbort_ = false;
     
    624624    }
    625625
    626     std::map<std::string, shared_ptr<Game::GameStateFactory> > Game::GameStateFactory::factories_s;
     626    /*static*/ std::map<std::string, shared_ptr<Game::GameStateFactory> >& Game::GameStateFactory::getFactories()
     627    {
     628        static std::map<std::string, shared_ptr<GameStateFactory> > factories;
     629        return factories;
     630    }
    627631
    628632    /*static*/ shared_ptr<GameState> Game::GameStateFactory::fabricate(const GameStateInfo& info)
    629633    {
    630         std::map<std::string, shared_ptr<Game::GameStateFactory> >::const_iterator it = factories_s.find(info.className);
    631         assert(it != factories_s.end());
     634        std::map<std::string, shared_ptr<Game::GameStateFactory> >::const_iterator it = getFactories().find(info.className);
     635        assert(it != getFactories().end());
    632636        return it->second->fabricateInternal(info);
    633637    }
Note: See TracChangeset for help on using the changeset viewer.