[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Iterating weak tables in Lua 5.1?
- From: Mark Hamburg <mhamburg@...>
- Date: Mon, 29 Nov 2004 08:40:17 -0800
I moved to Lua 5.1work2 this morning. We are getting occasional errors about
next not being happy with table keys. The code in question looks like the
following:
for item, _ in pairs( items ) do
items[ item ] = nil
process( item )
end
The additional catch is that items is a weak table.
Has weak table iteration become more dangerous in Lua 5.1? Do I need to turn
off the garbage collector around this code?
Thanks.
Mark