lua-users home
lua-l archive

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

Hey Steve,

Collectgarbage will only work if I set the functions/tables I want to delete
to nil - the question is how I differentiate the level-specific ones I do
want destroying from the global ones I don't..



-----Original Message-----
[] On Behalf Of steve donovan
Sent: 24 March 2010 11:08
To: Lua list
Subject: Re: Cleaning up specific lua scripts

On Wed, Mar 24, 2010 at 1:00 PM, Ricky Haggett <> wrote:
> Is there a way of doing this programmatically? I was thinking maybe I
> compare the state of global before and after loading a level-script to
> figure out the level specific stuff? But maybe there's an easier way?

Would not collectgarbage() do the job? May have to call it a few
times, use the 'count' argument before & after to see what you've
reclaimed.  And (of course) make sure there are genuinely no
references hanging around, non-weak tables being the big culprit