- Alex----- Original Message ----- From: liam mail If a Lua (5.1) function creates a local variable(actually it is a userdata and metatable with __gc method set ) and returns it to Cpp pushing it onto the stack, when does the garbage collector kick in for this variable.? Is it when the value is popped off the stack that the variable becomes "no longer active" or at a later time?