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

Method finalize

Source/Misc/luabind/src/class_rep.cpp:331–356  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

329}
330
331void luabind::detail::finalize(lua_State* L, class_rep* crep)
332{
333 if (crep->get_class_type() != class_rep::lua_class) return;
334
335// lua_pushvalue(L, -1); // copy the object ref
336 crep->get_table(L);
337 lua_pushliteral(L, "__finalize");
338 lua_gettable(L, -2);
339 lua_remove(L, -2);
340
341 if (lua_isnil(L, -1))
342 {
343 lua_pop(L, 1);
344 }
345 else
346 {
347 lua_pushvalue(L, -2);
348 lua_call(L, 1, 0);
349 }
350
351 for (std::vector<class_rep*>::const_iterator
352 i = crep->bases().begin(); i != crep->bases().end(); ++i)
353 {
354 if (*i) finalize(L, *i);
355 }
356}

Callers

nothing calls this directly

Calls 6

lua_gettableFunction · 0.85
lua_removeFunction · 0.85
lua_pushvalueFunction · 0.85
lua_callFunction · 0.85
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected