[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Iterating weak tables
- From: Mark Hamburg <mhamburg@...>
- Date: Sat, 30 Aug 2003 23:02:45 -0700
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