How to use lua_pop() function correctly?
问题 Can anyone pls tell me that how to use lua_pop() function correctly in C++. Should I call it when I use a lua_get*() function ? like. lua_getglobal(L, "something"); lua_pop(L, 1); or how to use it ? Will the garbage collector clear those stuff after the threshold ? Thanks. 回答1: You call lua_pop() to remove items from the Lua stack. For simple functions, this can be entirely unnecessary since the core will clean up the stack as part of handling the return values. For more complex functions,