[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Reseting/closing a thread/lua_State
- From: Duncan Cross <duncan.cross@...>
- Date: Thu, 3 Mar 2011 18:48:42 +0000
On Thu, Mar 3, 2011 at 6:36 PM, Teto <mattator@gmail.com> wrote:
> On Wed, Mar 2, 2011 at 12:37 AM, Luiz Henrique de Figueiredo
> <lhf@tecgraf.puc-rio.br> wrote:
>>
>> > Also I wanted to know what is the correct way to destroy a lua_state.
>> > lua_close(myState) ?
>>
>> Yes.
>>
>> > If I have a thread created from a mainState (lua_newthread(mainState).
>> > Can I close mainState without breaking the thread ?
>>
>> No. And you can only lua_close mainState, not the thread.
>
> So how do I close/remove a thread ? it will be cleaned up when closing
> mainState ?
>
> Thx your quick answer
>
>
You don't need to explicitly do anything to close/remove it. It is a
first-class object that will be garbage-collected when there are no
more references to it remaining in mainState.
-Duncan