[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: abort a lua_newthread from C and re-use its lua_State?
- From: "Rici Lake" <lua@...>
- Date: Mon, 30 Apr 2007 10:10:40 +0100 (BST)
Graham Wakefield wrote:
> 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.
>
Take a look at luai_userstatefree, defined (to nothing) in luaconf.h. This
hook is called when a lua_State (including the master state) is being
freed.