mirror of https://github.com/mgba-emu/mgba.git
Scripting: Code cleanup
This commit is contained in:
parent
0c675b12e4
commit
efb30080e8
|
@ -354,11 +354,7 @@ bool call(struct mScriptValue* obj, const char* method, struct mScriptFrame* fra
|
|||
if (!mScriptObjectGet(obj, method, &fn)) {
|
||||
return false;
|
||||
}
|
||||
struct mScriptValue* this = mScriptListAppend(&frame->arguments);
|
||||
this->type = mSCRIPT_TYPE_MS_WRAPPER;
|
||||
this->refs = mSCRIPT_VALUE_UNREF;
|
||||
this->flags = 0;
|
||||
this->value.opaque = obj;
|
||||
mSCRIPT_PUSH(&frame->arguments, WRAPPER, obj);
|
||||
return mScriptInvoke(&fn, frame);
|
||||
}
|
||||
|
||||
|
|
|
@ -1667,11 +1667,7 @@ void mScriptObjectFree(struct mScriptValue* value) {
|
|||
if (_accessRawMember(value->type->details.cls->free, value->value.opaque, value->type->isConst, &deinitMember)) {
|
||||
struct mScriptFrame frame;
|
||||
mScriptFrameInit(&frame);
|
||||
struct mScriptValue* this = mScriptListAppend(&frame.arguments);
|
||||
this->type = mSCRIPT_TYPE_MS_WRAPPER;
|
||||
this->refs = mSCRIPT_VALUE_UNREF;
|
||||
this->flags = 0;
|
||||
this->value.opaque = value;
|
||||
mSCRIPT_PUSH(&frame.arguments, WRAPPER, value);
|
||||
mScriptInvoke(&deinitMember, &frame);
|
||||
mScriptFrameDeinit(&frame);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue