[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Destroying yielded (but not finished) coroutines?
- From: Jan Kratochvíl <jan.kratochvil@...>
- Date: Fri, 14 Oct 2005 15:15:36 +0200
Luiz Henrique de Figueiredo wrote:
Well, but how? I create it using lua_newthread and so i have only
pointer to lua_state. I suppose that
mainthread somehow holds reference to this thread but i don't know how
to eliminate this reference.
I don't know how to mark this coroutine to be garbage collectable?
A coroutine is just like any other Lua value: it is collected when
no references exist for it. So, just make sure no such references
exist and it'll be collected. --lhf
Illusion softworks, a.s