Add check in RefObject::decr(); Fix decr() in removeAt see https://github.com/Microsoft/pxt/issues/3093 (#544)

This commit is contained in:
Michał Moskal
2017-10-01 22:39:25 +01:00
committed by Peli de Halleux
parent faae856e88
commit 9382535d29
2 changed files with 4 additions and 5 deletions

View File

@ -160,6 +160,7 @@ namespace pxt {
inline void unref()
{
//printf("DECR "); this->print();
check(refcnt > 0, ERR_REF_DELETED);
refcnt -= 2;
if (refcnt == 0) {
destroy();