Changeset 1233 for code/branches/network3/src/network/PacketDecoder.cc
- Timestamp:
- May 5, 2008, 11:14:45 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/network3/src/network/PacketDecoder.cc
r1232 r1233 181 181 if(currentState->compsize==0) 182 182 COUT(2) << "PacketDecoder: compsize is 0" << std::endl; 183 currentState->data = (unsigned char*)(malloc( currentState->compsize )); 183 // currentState->data = (unsigned char*)(malloc( currentState->compsize )); 184 currentState->data = new unsigned char[currentState->compsize]; 184 185 if(currentState->data==NULL) 185 186 COUT(2) << "PacketDecoder: Gamestatepacket-decoder: memory leak" << std::endl; … … 198 199 cid->id = ((classid *)(packet->data))->id; 199 200 cid->clid = ((classid *)(packet->data))->clid; 200 cid->message = (const char *)malloc(cid->length); 201 // cid->message = (const char *)malloc(cid->length); 202 cid->message = new char[cid->length]; 201 203 void *data = (void *)cid->message; 202 204 memcpy(data, (const void*)(packet->data+3*sizeof(int)), cid->length);
Note: See TracChangeset
for help on using the changeset viewer.