Scripting: Make mScriptEngineExportDocNamespace take ownership

This commit is contained in:
Vicki Pfau 2023-03-29 01:23:47 -07:00
parent 832d0a7c05
commit 4543bcf9de
2 changed files with 1 additions and 1 deletions

View File

@ -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);
}

View File

@ -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");