Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 28, 2007, 2:56:26 PM (17 years ago)
Author:
dumenim
Message:

added enet_packet_destroy to PacketGenerator/Decoder

File:
1 edited

Legend:

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

    r313 r315  
    5454        ack* a = new ack;
    5555        *a = *(ack*)packet->data; //press pattern of ack on new data
     56       
     57        //clean memory
     58        enet_packet_destroy( packet );
     59       
    5660        printAck( a ); //debug info
    5761}
     
    6266        //copy data of packet->data to new struct
    6367        *mouseMove = *(mouse*)packet->data;
     68       
     69        //clean memory
     70        enet_packet_destroy( packet );
     71       
    6472        printMouse( mouseMove ); //debug info
    6573}
     
    6977        keyboard* key = new keyboard;
    7078        *key = *(keyboard*)packet->data; //see above
     79       
     80        //clean memory
     81        enet_packet_destroy( packet );
     82       
    7183        printKey( key ); //debug info
     84
    7285}
    7386
     
    8396        //put pointer of chatting struct to the begining of the new generated char*
    8497        chatting->message = reserve;
     98       
     99        //clean memory
     100        enet_packet_destroy( packet );
     101       
    85102        printChat( chatting ); //debug info
     103       
    86104}
    87105
     
    100118        //copy the gamestate data
    101119        memcpy( (void*)(currentState->data), (const void*)(data+3*sizeof( int )), currentState->size );
     120       
     121        //clean memory
     122        enet_packet_destroy( packet );
    102123}
    103124
Note: See TracChangeset for help on using the changeset viewer.