Deallocating a dynamically allocated array of data must be done with delete[] instead of delete

This commit is contained in:
giorgiomarcias 2016-03-23 13:02:35 +00:00
parent bef4835ca2
commit 24fe5cb6a0
1 changed files with 1 additions and 1 deletions

View File

@ -53,7 +53,7 @@ public:
bool * newdataLoc = new bool[ sz ];
if(datasize!=0) memcpy(newdataLoc,data,sizeof(datasize));
std::swap(data,newdataLoc);
if(newdataLoc != 0) delete newdataLoc;
if(newdataLoc != 0) delete[] newdataLoc;
datareserve = sz;
}