[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: RE: tolua memory leak?
- From: "Eric Ries" <eries@...>
- Date: Wed, 2 May 2001 20:19:40 -0400
Excellent. If there is anything I can do to help/test/code, let me know
Eric
eries@there.com
> -----Original Message-----
> From: owner-lua-l@tecgraf.puc-rio.br
> [mailto:owner-lua-l@tecgraf.puc-rio.br]On Behalf Of Waldemar Celes
> Sent: Wednesday, May 02, 2001 6:39 PM
> To: Multiple recipients of list
> Subject: Re: tolua memory leak?
>
>
>
>
>
>
> > Does this mean that garbage collection for toLua-generated
> objects/userdata
> > will leak? Is there a workaround?
> >
>
> it seems it's true. tolua uses a Lua table to check the need of
> destructing the object, and that's should not be done. sorry!
>
> if you are not binding functions that return object by value,
> you can deactivate the gc tag method
> (doing that, objects returned by value will leak).
>
> to deactivate tolua gc, do not set the function "instance_gc" (in
> tolua_tm.c)
> as the gc tagmethod.
>
> the right solution (to be implemented) is to set the tagmethod only for
> objects returned by value. doing that, tolua can destruct the object
> in the gc function without performing additional checkings.
> to do that, it is needed to create a "clone_tag", similar to what
> is done to
> the "const_tag".
>
> this fix will get high priority in my to-do list.
>
> -- waldemar
>