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)) {
|
if (!mScriptObjectGet(obj, method, &fn)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
struct mScriptValue* this = mScriptListAppend(&frame->arguments);
|
mSCRIPT_PUSH(&frame->arguments, WRAPPER, obj);
|
||||||
this->type = mSCRIPT_TYPE_MS_WRAPPER;
|
|
||||||
this->refs = mSCRIPT_VALUE_UNREF;
|
|
||||||
this->flags = 0;
|
|
||||||
this->value.opaque = obj;
|
|
||||||
return mScriptInvoke(&fn, frame);
|
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)) {
|
if (_accessRawMember(value->type->details.cls->free, value->value.opaque, value->type->isConst, &deinitMember)) {
|
||||||
struct mScriptFrame frame;
|
struct mScriptFrame frame;
|
||||||
mScriptFrameInit(&frame);
|
mScriptFrameInit(&frame);
|
||||||
struct mScriptValue* this = mScriptListAppend(&frame.arguments);
|
mSCRIPT_PUSH(&frame.arguments, WRAPPER, value);
|
||||||
this->type = mSCRIPT_TYPE_MS_WRAPPER;
|
|
||||||
this->refs = mSCRIPT_VALUE_UNREF;
|
|
||||||
this->flags = 0;
|
|
||||||
this->value.opaque = value;
|
|
||||||
mScriptInvoke(&deinitMember, &frame);
|
mScriptInvoke(&deinitMember, &frame);
|
||||||
mScriptFrameDeinit(&frame);
|
mScriptFrameDeinit(&frame);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue