MCPcopy Create free account
hub / github.com/RomanKubiak/ctrlr / destroy_instance

Function destroy_instance

Source/Misc/luabind/src/object_rep.cpp:73–96  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

71 }
72
73 static int destroy_instance(lua_State* L)
74 {
75 object_rep* instance = static_cast<object_rep*>(lua_touserdata(L, 1));
76
77 lua_pushliteral(L, "__finalize");
78 lua_gettable(L, 1);
79
80 if (lua_isnil(L, -1))
81 {
82 lua_pop(L, 1);
83 }
84 else
85 {
86 lua_pushvalue(L, 1);
87 lua_call(L, 1, 0);
88 }
89
90 instance->release_dependency_refs(L);
91 instance->~object_rep();
92
93 lua_pushnil(L);
94 lua_setmetatable(L, 1);
95 return 0;
96 }
97
98 namespace
99 {

Callers

nothing calls this directly

Calls 8

lua_touserdataFunction · 0.85
lua_gettableFunction · 0.85
lua_pushvalueFunction · 0.85
lua_callFunction · 0.85
lua_pushnilFunction · 0.85
lua_setmetatableFunction · 0.85
~object_repMethod · 0.80

Tested by

no test coverage detected