lua-users home
lua-l archive

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


> > The Timer() function creates an userdata and stores the callback in a
> > weak-keyed table. The key is the Timer userdata, and the value is the
> > callback. The userdata is returned.

> At this point, unless you store the returned userdata in a variable,
> there is no strong reference to it.

Isn't the returned value a strong reference? It is even used to call a member 
function that creates a strong reference in the registry. Is this really different if I 
store the result in a local variable? 

do
  local t = Timer( function() print"timeout end )
  t:start(1)
end

- Jörg