lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Wednesday 11, Josh Haberman wrote:
> On Wed, Apr 11, 2012 at 12:00 PM, Robert G. Jakabosky
> 
> <bobby@sharedrealm.com> wrote:
> > On Wednesday 11, Josh Haberman wrote:
> >> I see.  In that case, using finalizers to implement a Lua-level
> >> atexit() doesn't seem like a viable technique.
> >> 
> >> https://github.com/dcurrie/lunit/blob/master/atexit.lua
> >> 
> >> Is there any other way to accomplish this?
> > 
> > [code snipped]
> 
> I'm confused; this seems equivalent to the code I linked to.  It
> similarly runs the atexit() handlers inside a finalizer.  I tried it
> with my test case (replacing "defer" with your "atexit") and it does
> not print "GC'd".

oops, sorry.  I thought there was atexit handler being registered from another 
atexit handler.  So the code I posted will not help with your use-case.

-- 
Robert G. Jakabosky