Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8394


Ignore:
Timestamp:
May 3, 2011, 9:19:52 AM (14 years ago)
Author:
scheusso
Message:

-fixed a memory leak (thx reto)
-some OrxVerify messages

Location:
code/trunk/src/libraries
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/libraries/core/ThreadPool.cc

    r8373 r8394  
    4141    ThreadPool::~ThreadPool()
    4242    {
    43         OrxVerify(this->setNrOfThreads(0) == 0, "" );
     43        OrxVerify(this->setNrOfThreads(0) == 0, "ERROR: could not join remaining threads in ThreadPool" );
    4444    }
    4545
     
    8989            {
    9090                // If that fails, then there is some code error
    91                 OrxVerify( (*it)->evaluateExecutor( executor ), "" );
     91                OrxVerify( (*it)->evaluateExecutor( executor ), "ERROR: could not evaluate Executor" );
    9292                return true;
    9393            }
     
    9696        {
    9797            addThreads( 1 );
    98             OrxVerify( this->threadPool_.back()->evaluateExecutor( executor ), "" ); // access the last element
     98            OrxVerify( this->threadPool_.back()->evaluateExecutor( executor ), "ERROR: could not evaluate Executor" ); // access the last element
    9999            return true;
    100100        }
  • code/trunk/src/libraries/network/GamestateManager.cc

    r8373 r8394  
    9494    assert(gs);
    9595    std::map<unsigned int, packet::Gamestate*>::iterator it = gamestateQueue.find(clientID);
    96     if(it!=gamestateQueue.end()){
     96    if(it!=gamestateQueue.end())
     97    {
    9798      // delete obsolete gamestate
    9899      delete it->second;
     
    108109    std::map<unsigned int, packet::Gamestate*>::iterator it;
    109110    // now push only the most recent gamestates we received (ignore obsolete ones)
    110     for(it = gamestateQueue.begin(); it!=gamestateQueue.end(); it++){
    111       OrxVerify(processGamestate(it->second), "");
     111    for(it = gamestateQueue.begin(); it!=gamestateQueue.end(); it++)
     112    {
     113      OrxVerify(processGamestate(it->second), "ERROR: could not process Gamestate");
    112114      sendAck( it->second->getID(), it->second->getPeerID() );
    113115      delete it->second;
     
    362364    if(gs->isCompressed())
    363365    {
    364        OrxVerify(gs->decompressData(), "");
     366       OrxVerify(gs->decompressData(), "ERROR: could not decompress Gamestate");
    365367    }
    366368    assert(!gs->isDiffed());
  • code/trunk/src/libraries/network/packet/Gamestate.cc

    r8373 r8394  
    202202    {
    203203//       COUT(4) << "updating object of classid " << objectheader.getClassID() << endl;
    204       OrxVerify(s->updateData(mem, mode), "");
     204      OrxVerify(s->updateData(mem, mode), "ERROR: could not update Synchronisable with Gamestate data");
    205205    }
    206206  }
     
    263263  uint8_t *d1 = data_+GamestateHeader::getSize();
    264264  uint8_t *d2 = gs.data_+GamestateHeader::getSize();
    265   GamestateHeader* h1 = new GamestateHeader(data_);
    266   GamestateHeader* h2 = new GamestateHeader(gs.data_);
    267   assert(h1->getDataSize() == h2->getDataSize());
     265  GamestateHeader h1(data_);
     266  GamestateHeader h2(gs.data_);
     267  assert(h1.getDataSize() == h2.getDataSize());
    268268  assert(!isCompressed());
    269269  assert(!gs.isCompressed());
    270   return memcmp(d1, d2, h1->getDataSize())==0;
     270  return memcmp(d1, d2, h1.getDataSize())==0;
    271271}
    272272
Note: See TracChangeset for help on using the changeset viewer.