Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8273 in orxonox.OLD for branches/network


Ignore:
Timestamp:
Jun 8, 2006, 4:59:51 PM (18 years ago)
Author:
rennerc
Message:

removed some memory leaks

Location:
branches/network/src/lib/network
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/network/src/lib/network/data_stream.cc

    r7954 r8273  
    5353DataStream::~DataStream()
    5454{
    55 
     55  delete [] this->upBuffer;
     56  this->upBuffer = NULL;
     57  delete [] this->downBuffer;
     58  this->downBuffer = NULL;
    5659}
    5760
     
    120123int passUp(byte* data)
    121124{
    122 
     125  return 0;
    123126}
  • branches/network/src/lib/network/message_manager.cc

    r8228 r8273  
    4747      if ( it2->data )
    4848      {
    49         delete it2->data;
     49        delete [] it2->data;
    5050        it2->data = NULL;
    5151      }
  • branches/network/src/lib/network/network_game_manager.cc

    r8228 r8273  
    7070NetworkGameManager::~NetworkGameManager()
    7171{
     72  delete MessageManager::getInstance();
    7273}
    7374
  • branches/network/src/lib/network/synchronizeable.cc

    r8244 r8273  
    7272  if ( this->isServer() && this->beSynchronized() && this->getUniqueID() > 0 )
    7373    NetworkGameManager::getInstance()->removeSynchronizeable( this->getUniqueID() );
     74   
     75  for ( SyncVarList::iterator it = syncVarList.begin(); it != syncVarList.end(); it++ )
     76  {
     77    delete *it;
     78  }
     79  syncVarList.clear();
     80 
     81  for ( UserStateHistory::iterator it = recvStates.begin(); it != recvStates.end(); it++ )
     82  {
     83    for ( StateHistory::iterator it2 = it->begin(); it2 != it->end(); it2++ )
     84    {
     85      delete [] (*it2)->data;
     86      delete *it2;
     87    }
     88
     89  }
     90 
     91  for ( UserStateHistory::iterator it = sentStates.begin(); it != sentStates.end(); it++ )
     92  {
     93    for ( StateHistory::iterator it2 = it->begin(); it2 != it->end(); it2++ )
     94    {
     95      delete [] (*it2)->data;
     96      delete *it2;
     97    }
     98
     99  }
    74100}
    75101
     
    159185
    160186    stateFrom = initialEntry;
     187   
     188    sentStates[userId].push_back( stateFrom );
    161189  }
    162190  else
     
    278306
    279307    stateFrom = initialEntry;
     308   
     309    recvStates[userId].push_back( stateFrom );
    280310  }
    281311  else
     
    442472      if ( (*delIt)->data )
    443473        delete [] (*delIt)->data;
     474      delete *delIt;
    444475      recvStates[userId].erase( delIt );
    445476     
     
    510541      if ( (*delIt)->data )
    511542        delete [] (*delIt)->data;
     543      delete *delIt;
    512544      sentStates[userId].erase( delIt );
    513545     
Note: See TracChangeset for help on using the changeset viewer.