mirror of https://github.com/mgba-emu/mgba.git
Scripting: Fix early freeing of coerced list contents (fixes #2881)
This commit is contained in:
parent
3f108aae75
commit
1b85fb3de5
|
@ -630,6 +630,14 @@ struct mScriptValue* _luaCoerceTable(struct mScriptEngineContextLua* luaContext,
|
|||
mScriptValueDeref(list);
|
||||
return table;
|
||||
}
|
||||
for (i = 0; i < mScriptListSize(list->value.list); ++i) {
|
||||
struct mScriptValue* value = mScriptListGetPointer(list->value.list, i);
|
||||
if (value->type->base != mSCRIPT_TYPE_WRAPPER) {
|
||||
continue;
|
||||
}
|
||||
value = mScriptValueUnwrap(value);
|
||||
mScriptValueRef(value);
|
||||
}
|
||||
mScriptValueDeref(table);
|
||||
return list;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue