[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Userdata finalization order
- From: Javier Guerra Giraldez <javier@...>
- Date: Tue, 19 Oct 2010 10:20:01 -0500
On Tue, Oct 19, 2010 at 10:06 AM, Francesco Abbate
> As you can see the object "ln" can exists indipendently from any plot
> but it can also be attached to one or many plot (this is the zero,
> one, infinity principle, I guess :-) )
in this case, the library designer had to either:
a) implement reference counting.
b) leave the counting to you.
if a), then it's not Lua problem, just don't destroy the line object,
they will be destroyed when no plot uses it
if b), then it's not Lua fault that you have to keep track of the C++
objects. of course, the easiest is to add a refcount to the userdata