lua-users home
lua-l archive

Re: doubt about gc

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


> Ah, you mean to remove the t entry in Private when t is collected?
> In Lua 3.2 you can set the "gc" tag method of t so that it removes the
entry
> in Private. In 4.0, this is no longer allowed but perhaps it will in 4.1.
Yeah! :-)
This piece of code is sufficient to resolve the problem?
settagmethod(tag(Public), "gc", function(t)
 %Private[t] = nil
end)
Regards,
Milano

AltStyle によって変換されたページ (->オリジナル) /