lua-users home
lua-l archive

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


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
with luabind.

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
thread ?

Let me know if it isn't clear