lua-users home
lua-l archive

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


Another thought - is it possible to get some kind of callback from a lua_State when it is collected?  This would allow me to free C resources attached to it and prevent my memory leak.  Something like a __gc method for states created via lua_newthread.

Thanks

On Apr 29, 2007, at 7:46 AM, Rici Lake wrote:

Graham Wakefield wrote:
That's really too bad; here's my vote for adding the thread reset API.

So, if I can't re-use the thread, how can I at least free it to allow
its resources and variables allocated to be collected?  Is this
possible?

If there are no references to it, and it has references to things
otherwise unreferenced, then those things will get garbage
collected along with the thread.

So just delete any reference to it which you have and it
will all get cleaned up.



grrr waaa
www.grahamwakefield.net