Skip to content

Commit

Permalink
Fixed a bug with destroying dynamic arrays.
Browse files Browse the repository at this point in the history
  • Loading branch information
TheLat committed Jul 8, 2015
1 parent 030f502 commit e0e4c00
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions mm.h
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,8 @@ template <class T, int N=-1> class Pointer {
if (IsArray())
FollowTrail();
Set(-1);
if (IsArray())
SetLength(0);
}
bool IsGood() const{
if (index >= 0 && Size() > 0)
Expand Down Expand Up @@ -529,6 +531,7 @@ class mm {
sizes[index] = 0;
delete[] tables[index];
goodIndex[index] = -1;
return;
}
if (out < sizes[index]) {
char* newtable = new(char[(index + sizeof(int))*out]);
Expand Down

0 comments on commit e0e4c00

Please sign in to comment.