Hello. I have this code: http://pastebin.com/84B2ZaN0 Output is > ++++++++ > term context > Socket:close > close socket Socket does not collect while garbage collecting and stay alive until lua state is close. Same result with Lua 5.1 and luaffi library. This example works with Lua 5.2 and luaffi library. Socket collect before `print("++++++++")`