lua-users home
lua-l archive

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


I tried setting foo and fooTable to nil too, and after I call lua_setgcthreshold(L, 0) there still seems to be some strings allocated.

Is there a simple way to traverse the entire registry and globals table to dump it out and see what's in there from C?



----- Original Message ----- From: "David Jones" <drj@pobox.com>
To: "Lua list" <lua@bazar2.conectiva.com.br>
Sent: Friday, June 23, 2006 6:16 PM
Subject: Re: Collecting dead strings



On 23 Jun 2006, at 11:03, Research wrote:

Hi,
I need to know how to properly destroy my lua code when it's no longer needed in my game engine.

If I have:

function f29d8()
   -- some code
end

foo = f29d8
fooTable = t29d8
t29d8.scriptFunction = f29d8

Is setting f29d8 = nil and t29d8 = nil good enough to cause foo and fooTable to be garbage collected if I call lua_setgcthreshold(L, 0)?

No.


Or do I need to explicitly set each reference to nil too?

Yes.

drj