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

Function DeleteScript

engine/gui/src/gui.cpp:4769–4781  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4767 }
4768
4769 void DeleteScript(HScript script)
4770 {
4771 lua_State* L = script->m_Context->m_LuaState;
4772 for (int i = 0; i < MAX_SCRIPT_FUNCTION_COUNT; ++i) {
4773 if (script->m_FunctionReferences[i] != LUA_NOREF) {
4774 dmScript::Unref(L, LUA_REGISTRYINDEX, script->m_FunctionReferences[i]);
4775 }
4776 }
4777 dmScript::Unref(L, LUA_REGISTRYINDEX, script->m_InstanceReference);
4778 free((void*)script->m_SourceFileName);
4779 script->~Script();
4780 ResetScript(script);
4781 }
4782
4783 Result SetScript(HScript script, dmLuaDDF::LuaSource *source)
4784 {

Callers 3

TEST_FFunction · 0.50
TearDownMethod · 0.50
TEST_FFunction · 0.50

Calls 3

UnrefFunction · 0.85
freeFunction · 0.85
ResetScriptFunction · 0.70

Tested by 3

TEST_FFunction · 0.40
TearDownMethod · 0.40
TEST_FFunction · 0.40