From ba7863605cfb3692296299d334239b42bcbbd5fb Mon Sep 17 00:00:00 2001 From: ZappoMan Date: Fri, 7 Jun 2013 10:49:43 -0700 Subject: [PATCH] fix several delete/delete[] mismatches --- interface/src/Application.cpp | 6 +++--- libraries/shared/src/SharedUtil.cpp | 2 +- libraries/voxels/src/VoxelTree.cpp | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 94b9643bf9..acb82412ca 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -1151,7 +1151,7 @@ static void sendVoxelEditMessage(PACKET_HEADER header, VoxelDetail& detail) { if (createVoxelEditMessage(header, 0, 1, &detail, bufferOut, sizeOut)){ AgentList::getInstance()->broadcastToAgents(bufferOut, sizeOut, &AGENT_TYPE_VOXEL, 1); - delete bufferOut; + delete[] bufferOut; } } @@ -1287,7 +1287,7 @@ void Application::importVoxels() { } if (calculatedOctCode) { - delete calculatedOctCode; + delete[] calculatedOctCode; } // restore the main window's active state @@ -1339,7 +1339,7 @@ void Application::pasteVoxels() { } if (calculatedOctCode) { - delete calculatedOctCode; + delete[] calculatedOctCode; } } diff --git a/libraries/shared/src/SharedUtil.cpp b/libraries/shared/src/SharedUtil.cpp index cf9e5f9b78..30aa75b461 100644 --- a/libraries/shared/src/SharedUtil.cpp +++ b/libraries/shared/src/SharedUtil.cpp @@ -223,7 +223,7 @@ bool createVoxelEditMessage(unsigned char command, short int sequence, actualMessageSize+=lengthOfVoxelData; } // cleanup - delete voxelData; + delete[] voxelData; } if (success) { diff --git a/libraries/voxels/src/VoxelTree.cpp b/libraries/voxels/src/VoxelTree.cpp index 4e2de6afc6..b67e87597a 100644 --- a/libraries/voxels/src/VoxelTree.cpp +++ b/libraries/voxels/src/VoxelTree.cpp @@ -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) { unsigned char* octalCode = pointToVoxel(x,y,z,s,0,0,0); 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) { node = NULL; } - delete octalCode; // cleanup memory + delete[] octalCode; // cleanup memory 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* voxelData = pointToVoxel(x,y,z,s,red,green,blue); this->readCodeColorBufferToTree(voxelData, destructive); - delete voxelData; + delete[] voxelData; }