Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3256 for code


Ignore:
Timestamp:
Jun 30, 2009, 2:44:06 PM (15 years ago)
Author:
scheusso
Message:

added NetworkFunctionBase::destroyAllNetworkFunctions to cleanup premain created stuff

Location:
code/branches/netp6/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • code/branches/netp6/src/network/NetworkFunction.cc

    r3214 r3256  
    5656 
    5757 
     58  void NetworkFunctionBase::destroyAllNetworkFunctions()
     59  {
     60    std::map<std::string, NetworkFunctionBase*>::iterator it;
     61    for( it=NetworkFunctionBase::nameMap_.begin(); it!=NetworkFunctionBase::nameMap_.end(); ++it )
     62      delete it->second;
     63  }
     64 
    5865 
    5966  NetworkFunctionStatic::NetworkFunctionStatic(FunctorStatic* functor, const std::string& name, const NetworkFunctionPointer& p):
  • code/branches/netp6/src/network/NetworkFunction.h

    r3214 r3256  
    8080   
    8181    static inline void setNetworkID(const std::string& name, uint32_t id){ assert( nameMap_.find(name)!=nameMap_.end() ); nameMap_[name]->setNetworkID(id); }
     82   
     83    static void destroyAllNetworkFunctions();
    8284   
    8385  protected:
  • code/branches/netp6/src/orxonox/gamestates/GSRoot.cc

    r3196 r3256  
    3737#include "interfaces/TimeFactorListener.h"
    3838#include "interfaces/Tickable.h"
     39#include "network/NetworkFunction.h"
    3940
    4041namespace orxonox
     
    6061    GSRoot::~GSRoot()
    6162    {
     63        NetworkFunctionBase::destroyAllNetworkFunctions();
    6264    }
    6365
Note: See TracChangeset for help on using the changeset viewer.