fix several delete/delete[] mismatches

This commit is contained in:
ZappoMan 2013-06-07 10:49:43 -07:00
parent c2fd9d0d8d
commit ba7863605c
3 changed files with 7 additions and 7 deletions

View file

@ -1151,7 +1151,7 @@ static void sendVoxelEditMessage(PACKET_HEADER header, VoxelDetail& detail) {
if (createVoxelEditMessage(header, 0, 1, &detail, bufferOut, sizeOut)){ if (createVoxelEditMessage(header, 0, 1, &detail, bufferOut, sizeOut)){
AgentList::getInstance()->broadcastToAgents(bufferOut, sizeOut, &AGENT_TYPE_VOXEL, 1); AgentList::getInstance()->broadcastToAgents(bufferOut, sizeOut, &AGENT_TYPE_VOXEL, 1);
delete bufferOut; delete[] bufferOut;
} }
} }
@ -1287,7 +1287,7 @@ void Application::importVoxels() {
} }
if (calculatedOctCode) { if (calculatedOctCode) {
delete calculatedOctCode; delete[] calculatedOctCode;
} }
// restore the main window's active state // restore the main window's active state
@ -1339,7 +1339,7 @@ void Application::pasteVoxels() {
} }
if (calculatedOctCode) { if (calculatedOctCode) {
delete calculatedOctCode; delete[] calculatedOctCode;
} }
} }

View file

@ -223,7 +223,7 @@ bool createVoxelEditMessage(unsigned char command, short int sequence,
actualMessageSize+=lengthOfVoxelData; actualMessageSize+=lengthOfVoxelData;
} }
// cleanup // cleanup
delete voxelData; delete[] voxelData;
} }
if (success) { if (success) {

View file

@ -260,7 +260,7 @@ void VoxelTree::readBitstreamToTree(unsigned char * bitstream, unsigned long int
void VoxelTree::deleteVoxelAt(float x, float y, float z, float s, bool stage) { void VoxelTree::deleteVoxelAt(float x, float y, float z, float s, bool stage) {
unsigned char* octalCode = pointToVoxel(x,y,z,s,0,0,0); unsigned char* octalCode = pointToVoxel(x,y,z,s,0,0,0);
deleteVoxelCodeFromTree(octalCode, stage); deleteVoxelCodeFromTree(octalCode, stage);
delete octalCode; // cleanup memory delete[] octalCode; // cleanup memory
} }
@ -627,7 +627,7 @@ VoxelNode* VoxelTree::getVoxelAt(float x, float y, float z, float s) const {
if (*node->getOctalCode() != *octalCode) { if (*node->getOctalCode() != *octalCode) {
node = NULL; node = NULL;
} }
delete octalCode; // cleanup memory delete[] octalCode; // cleanup memory
return node; return node;
} }
@ -635,7 +635,7 @@ void VoxelTree::createVoxel(float x, float y, float z, float s,
unsigned char red, unsigned char green, unsigned char blue, bool destructive) { unsigned char red, unsigned char green, unsigned char blue, bool destructive) {
unsigned char* voxelData = pointToVoxel(x,y,z,s,red,green,blue); unsigned char* voxelData = pointToVoxel(x,y,z,s,red,green,blue);
this->readCodeColorBufferToTree(voxelData, destructive); this->readCodeColorBufferToTree(voxelData, destructive);
delete voxelData; delete[] voxelData;
} }