lua-users home
lua-l archive

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


On Tue, Oct 19, 2010 at 10:06 AM, Francesco Abbate
<francesco.bbt@gmail.com> wrote:
> 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.
or
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

-- 
Javier