MCPcopy Create free account
hub / github.com/Tencent/UnLua / Lpb_delete

Function Lpb_delete

Plugins/UnLuaExtensions/LuaProtobuf/Source/src/pb.cpp:167–181  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

165{ LS->dec_hooks_index = lpb_reftable(L, LS->dec_hooks_index); }
166
167static int Lpb_delete(lua_State *L) {
168 lpb_State *LS = (lpb_State*)luaL_testudata(L, 1, PB_STATE);
169 if (LS != NULL) {
170 const pb_State *GS = global_state;
171 pb_free(&LS->local);
172 if (&LS->local == GS)
173 global_state = NULL;
174 LS->state = NULL;
175 pb_resetbuffer(&LS->buffer);
176 luaL_unref(L, LUA_REGISTRYINDEX, LS->defs_index);
177 luaL_unref(L, LUA_REGISTRYINDEX, LS->enc_hooks_index);
178 luaL_unref(L, LUA_REGISTRYINDEX, LS->dec_hooks_index);
179 }
180 return 0;
181}
182
183LUALIB_API lpb_State *lpb_lstate(lua_State *L) {
184 lpb_State *LS;

Callers

nothing calls this directly

Calls 4

pb_freeFunction · 0.85
pb_resetbufferFunction · 0.85
luaL_unrefFunction · 0.85
luaL_testudataFunction · 0.70

Tested by

no test coverage detected