lua-users home
lua-l archive

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


If t is a weak table and I do the following:

    for k, v in pairs( t )
        -- do something that might trigger garbage collection
        -- thereby eliminating some entries in t
    end

Do I risk having the iteration get fouled by having entries in the table get
cleared? Fouled includes missing entries that don't get cleared.

Should I bracket this with code to remove and restore the metatable for t?
Will that work?

Thanks.
Mark