[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Memory leak?
- From: "Patrick Donnelly" <batrick.donnelly@...>
- Date: Wed, 30 Jan 2008 05:00:32 -0700
I'm pretty sure this has to do with tables remembering "old" keys.
This is important for next() when you try to check the next key/value
pair 'after' removing the last...
for k in pairs(t) do t[k] = nil end
Note that if you try to call next() with an invalid key (one that was
never in the table), you get an error raised.
While assigning a new table does "fix" it, there probably should be
some sort of collection of these unused keys.
Note: I'm sure some of what I said is technically misleading (due to
my misunderstanding), but I hope the general idea is understood.
"One of the lessons of history is that nothing is often a good thing
to do and always a clever thing to say."