Placement new occurances need explicit delete

This commit is contained in:
Abhijith 2016-12-07 18:00:03 -08:00
parent 21473f5b9b
commit 6398a42dad

View File

@ -131,7 +131,9 @@ namespace pxt {
if (refmask[i]) decr(r->fields[i]); if (refmask[i]) decr(r->fields[i]);
r->fields[i] = 0; r->fields[i] = 0;
} }
delete r; //RefRecord is allocated using placement new
r->~RefRecord();
::operator delete(r);
} }
void RefRecord_print(RefRecord *r) void RefRecord_print(RefRecord *r)
@ -259,7 +261,9 @@ namespace pxt {
decr(fields[i]); decr(fields[i]);
fields[i] = 0; fields[i] = 0;
} }
delete this; //RefAction is allocated using placement new
this->~RefAction();
::operator delete(this);
} }
void RefAction::print() void RefAction::print()