[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Reseting/closing a thread/lua_State
- From: Teto <mattator@...>
- Date: Tue, 1 Mar 2011 23:52:40 +0100
I am developing some kind of game and as I am not very familiar with
lua I write many mistakes in my lua code. To debug more quickly my
scripts, I press 'R' and it destroys my lua_state thread and recreates
it from a main lua state ( _script.reset(
engine()->getScriptingVM()->createThread() ); ), rebinding things
I wanted to know if it was the correct way to reset a thread depending
on a main lua_state. Can't we reset a thread so that it knows only
about the state it shares context with ?
Also I wanted to know what is the correct way to destroy a lua_state.
lua_close(myState) ? If I have a thread created from a mainState
(lua_newthread(mainState). Can I close mainState without breaking the
Let me know if it isn't clear