MCPcopy Create free account
hub / github.com/defold/defold / Finalize

Function Finalize

engine/script/src/script.cpp:304–325  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

302 }
303
304 void Finalize(HContext context)
305 {
306 lua_State* L = context->m_LuaState;
307
308 for (HScriptExtension* l = context->m_ScriptExtensions.Begin(); l != context->m_ScriptExtensions.End(); ++l)
309 {
310 if ((*l)->Finalize != 0x0)
311 {
312 (*l)->Finalize(context);
313 }
314 }
315
316 lua_getglobal(L, RANDOM_SEED);
317 uint32_t* seed = (uint32_t*) lua_touserdata(L, -1);
318 free(seed);
319 lua_pop(L, 1);
320
321 Unref(L, LUA_REGISTRYINDEX, context->m_ContextTableRef);
322 Unref(L, LUA_REGISTRYINDEX, context->m_ContextWeakTableRef);
323 context->m_ContextTableRef = LUA_NOREF;
324 context->m_ContextWeakTableRef = LUA_NOREF;
325 }
326
327 lua_State* GetLuaState(HContext context)
328 {

Callers 4

TearDownMethod · 0.50
TearDownMethod · 0.50
TEST_FFunction · 0.50
TearDownMethod · 0.50

Calls 5

lua_touserdataFunction · 0.85
freeFunction · 0.85
UnrefFunction · 0.85
BeginMethod · 0.45
EndMethod · 0.45

Tested by 4

TearDownMethod · 0.40
TearDownMethod · 0.40
TEST_FFunction · 0.40
TearDownMethod · 0.40