mirror of https://github.com/mgba-emu/mgba.git
Scripting: Make mScriptEngineExportDocNamespace take ownership
This commit is contained in:
parent
832d0a7c05
commit
4543bcf9de
|
@ -356,6 +356,7 @@ void mScriptEngineExportDocNamespace(struct mScriptEngineContext* ctx, const cha
|
|||
struct mScriptValue* key = mScriptStringCreateFromUTF8(values[i].key);
|
||||
mScriptTableInsert(table, key, values[i].value);
|
||||
mScriptValueDeref(key);
|
||||
mScriptValueDeref(values[i].value);
|
||||
}
|
||||
HashTableInsert(&ctx->docroot, nspace, table);
|
||||
}
|
||||
|
|
|
@ -449,7 +449,6 @@ struct mScriptEngineContext* _luaCreate(struct mScriptEngine2* engine, struct mS
|
|||
mSCRIPT_KV_PAIR(connect, mSCRIPT_VALUE_DOC_FUNCTION(socket_connect)),
|
||||
mSCRIPT_KV_SENTINEL
|
||||
});
|
||||
mScriptValueDeref(errors);
|
||||
mScriptEngineSetDocstring(&luaContext->d, "socket", "A basic TCP socket library");
|
||||
mScriptEngineSetDocstring(&luaContext->d, "socket.ERRORS",
|
||||
"Error strings corresponding to the C.SOCKERR error codes, indexed both by name and by value");
|
||||
|
|
Loading…
Reference in New Issue