Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 8, 2008, 11:53:58 AM (16 years ago)
Author:
scheusso
Message:

some enhanced memory handling

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/network3/src/network/PacketDecoder.cc

    r1245 r1248  
    9090    return false;
    9191  }
     92 
     93  // ATTENTION: TODO watch, that arguments we pass over to the processFunction gets deleted in THE PROCESSXXX function
    9294
    9395  //following are the decode functions for the data of the packets
     
    101103    COUT(4) << "PacketDecoder: got ack id: " << a->a << std::endl;
    102104    processAck( a, clientId ); //debug info
    103 
    104105    //clean memory
    105106    enet_packet_destroy( packet );
     
    121122    //clean memory
    122123    enet_packet_destroy( packet );
    123 
    124124    printMouse( mouseMove ); //debug info
    125125  }
     
    132132    //clean memory
    133133    enet_packet_destroy( packet );
    134 
    135134    printKey( key ); //debug info
    136135
     
    232231  {
    233232    printChat(data, clientId);
     233    delete[] data->message;
     234    delete data;
    234235  }
    235236
    236237  void PacketDecoder::processGamestate( GameStateCompressed *state, int clientID )
    237238  {
    238     COUT(5) << "PacketDecoder: processing Gamestate" << std::endl;
     239    COUT(3) << "PacketDecoder-process: processing Gamestate" << std::endl;
    239240    //printGamestate( state );
     241    delete[] state->data;
     242    delete state;
    240243  }
    241244
     
    243246  {
    244247    printClassid(cid);
     248    delete cid;
    245249    return;
    246250  }
     
    249253  {
    250254    printAck(data);
     255    delete data;
    251256    return;
    252257  }
    253258 
    254259  bool PacketDecoder::processWelcome( welcome *w ){
     260    delete w;
    255261    return true;
    256262  }
     
    258264  bool PacketDecoder::processConnectRequest( connectRequest *con, int clientID ){
    259265    COUT(3) << "packetdecoder: processing connectRequest" << std::endl;
     266    delete con;
    260267    return true;
    261268  }
Note: See TracChangeset for help on using the changeset viewer.