Fix crash when modifying a table from within its &expire_func

This commit is contained in:
Jon Siwek 2018-10-12 08:33:32 -04:00
parent 0f55080625
commit 8792f5545c
5 changed files with 57 additions and 4 deletions

View file

@ -2361,8 +2361,6 @@ void TableVal::DoExpire(double t)
else if ( v->ExpireAccessTime() + timeout < t )
{
Val* val = v->Value();
if ( expire_func )
{
Val* idx = RecoverIndex(k);
@ -2403,8 +2401,8 @@ void TableVal::DoExpire(double t)
new StateAccess(OP_EXPIRE, this, k));
tbl->RemoveEntry(k);
Unref(v->Value());
delete v;
Unref(val);
Modified();
}