__gc not being called in LuaJIT

  • From: Sean Dunn <seanedunn@xxxxxxxxx>
  • To: "luajit@xxxxxxxxxxxxx" <luajit@xxxxxxxxxxxxx>
  • Date: Mon, 21 May 2012 09:32:49 -0700 (PDT)

Quick question. I use tolua++ to wrap my C++ classes in LuaJIT. I've noticed 
that there are situations where LuaJIT does not call the __gc metamethod for my 
object, which causes a memory leak. I haven't found anything in the archives 
mentioning this, but I did notice that the latest beta release 2.0.0-beta10 has 
the changelog comment "Ensure running __gc of userdata created in __gc at state 
close."

I take this as meaning that there was memory leak in pre-2.0.0-beta10 builds of 
LuaJIT. Can someone confirm this?

Thanks,
Sean
 
--

Other related posts: