[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: finalizer not called for userdata created inside finalizer
- From: "Robert G. Jakabosky" <bobby@...>
- Date: Wed, 11 Apr 2012 12:54:14 -0700
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