Merge pull request #320 from Microsoft/delete

Placement new occurances need explicit delete
This commit is contained in:
Abhijith Chatra 2016-12-07 18:09:35 -08:00 committed by GitHub
commit aa6cb58dca

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()