- Timestamp:
- Oct 31, 2008, 12:05:12 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/objecthierarchy/src/network/packet/Gamestate.cc
r2062 r2070 286 286 //copy over the header 287 287 *GAMESTATE_HEADER(ndata) = *HEADER; 288 //delete old (compressed data) 289 delete[] data_; 288 289 if (this->bDataENetAllocated_){ 290 // Memory was allocated by ENet. --> We let it be since enet_packet_destroy will 291 // deallocated it anyway. So data and packet stay together. 292 this->bDataENetAllocated_ = false; 293 } 294 else{ 295 // We allocated the memory in the first place (unlikely). So we destroy the old data 296 // and overwrite it with the new decompressed data. 297 delete[] this->data_; 298 } 299 290 300 //set new pointers 291 301 data_ = ndata;
Note: See TracChangeset
for help on using the changeset viewer.