lua-users home
lua-l archive

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


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".

Josh