ffi.gc prevent collect object

  • From: Alexey Melnichuk <mimir@xxxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Thu, 14 Nov 2013 14:15:33 +0400

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("++++++++")`



Other related posts: