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

Function DeleteScript

engine/gameobject/src/gameobject/gameobject_script.cpp:2405–2418  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2403 }
2404
2405 void DeleteScript(HScript script)
2406 {
2407 lua_State* L = script->m_LuaState;
2408 for (uint32_t i = 0; i < MAX_SCRIPT_FUNCTION_COUNT; ++i)
2409 {
2410 if (script->m_FunctionReferences[i] != LUA_NOREF) {
2411 dmScript::Unref(L, LUA_REGISTRYINDEX, script->m_FunctionReferences[i]);
2412 }
2413 }
2414
2415 dmScript::Unref(L, LUA_REGISTRYINDEX, script->m_InstanceReference);
2416 script->~Script();
2417 ResetScript(script);
2418 }
2419
2420 static PropertyResult GetPropertyDefault(const HProperties properties, uintptr_t user_data, dmhash_t id, PropertyVar& out_var)
2421 {

Callers 4

NewScriptFunction · 0.70
ResScriptCreateFunction · 0.70
ResScriptDestroyFunction · 0.70
ResDestroyGuiScriptFunction · 0.50

Calls 2

UnrefFunction · 0.85
ResetScriptFunction · 0.70

Tested by

no test coverage detected