Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3227


Ignore:
Timestamp:
Jun 23, 2009, 8:53:51 PM (16 years ago)
Author:
scheusso
Message:

some cleaning up and memory leak fixes

Location:
code/branches/netp6/src
Files:
2 deleted
8 edited

Legend:

Unmodified
Added
Removed
  • code/branches/netp6/src/network/CMakeLists.txt

    r3214 r3227  
    3131  NetworkFunction.cc
    3232  Host.cc
    33   PacketBuffer.cc
    3433  Server.cc
    3534  ServerConnection.cc
  • code/branches/netp6/src/network/GamestateClient.cc

    r3214 r3227  
    5252
    5353  GamestateClient::~GamestateClient() {
     54      std::map<unsigned int, packet::Gamestate *>::iterator it;
     55      for ( it = this->gamestateMap_.begin(); it != this->gamestateMap_.end(); ++it )
     56          delete (*it).second;
     57      if( this->tempGamestate_ )
     58          delete this->tempGamestate_;
    5459  }
    5560
  • code/branches/netp6/src/network/GamestateClient.h

    r3214 r3227  
    7373    std::map<unsigned int, packet::Gamestate *> gamestateMap_;
    7474    packet::Gamestate *tempGamestate_; // we save the received gamestates here during processQueue
    75     unsigned char *shipCache_;
    7675
    7776  };
  • code/branches/netp6/src/network/GamestateManager.cc

    r3214 r3227  
    6161  {
    6262    if( this->reference )
    63       delete this->reference;
    64     for( std::map<unsigned int, packet::Gamestate*>::iterator it = gamestateQueue.begin(); it != gamestateQueue.end(); it++ )
     63        delete this->reference;std::map<unsigned int, packet::Gamestate*>::iterator it;
     64    for( it = gamestateQueue.begin(); it != gamestateQueue.end(); ++it )
    6565      delete (*it).second;
     66    std::map<unsigned int, std::map<unsigned int, packet::Gamestate*> >::iterator it1;
     67    std::map<unsigned int, packet::Gamestate*>::iterator it2;
     68    for( it1 = gamestateMap_.begin(); it1 != gamestateMap_.end(); ++it1 )
     69    {
     70      for( it2 = it1->second.begin(); it2 != it1->second.end(); ++it2 )
     71        delete (*it2).second;
     72    }
    6673    delete trafficControl_;
    6774  }
  • code/branches/netp6/src/network/NetworkPrereqs.h

    r3214 r3227  
    102102  template <class T> class NetworkMemeberFunction;
    103103  struct NetworkFunctionPointer;
    104   class PacketBuffer;
    105104  class Server;
    106105  class ServerConnection;
  • code/branches/netp6/src/network/synchronisable/Synchronisable.h

    r3214 r3227  
    4343#include "NetworkCallback.h"
    4444
    45 /*#define REGISTERDATA(varname, ...) \
    46     registerVariable((void*)&varname, sizeof(varname), DATA, __VA_ARGS__)
    47 #define REGISTERSTRING(stringname, ...) \
    48     registerVariable(&stringname, stringname.length()+1, STRING, __VA_ARGS__)*/
    4945
    5046namespace orxonox
  • code/branches/netp6/src/network/synchronisable/SynchronisableSpecialisations.cc

    r3214 r3227  
    7373    registerVariable(variable.y, mode, cb, bidirectional);
    7474  }
    75 //   template <> void Synchronisable::registerVariable( Vector2& variable, uint8_t mode, NetworkCallbackBase* cb, bool bidirectional)
    76 //   {
    77 //     registerVariable( (const ColourValue&)variable, mode, cb, bidirectional);
    78 //   }
    7975 
    8076  template <> void Synchronisable::registerVariable( const Vector3& variable, uint8_t mode, NetworkCallbackBase* cb, bool bidirectional)
  • code/branches/netp6/src/util/Serialise.h

    r3084 r3227  
    408408    template <> inline void loadAndIncrease( const std::string& variable, uint8_t*& mem )
    409409    {
    410         *(std::string*)( &variable ) = std::string((const char *)mem);
     410        *(std::string*)( &variable ) = (const char *)mem;
    411411        mem += variable.length()+1;
    412412    }
     
    414414    template <> inline bool checkEquality( const std::string& variable, uint8_t* mem )
    415415    {
    416         return std::string((const char*)mem)==variable;
     416        //return std::string((const char*)mem)==variable;
     417        return (const char*)mem==variable;
    417418    }
    418419
Note: See TracChangeset for help on using the changeset viewer.