lua-users home
lua-l archive

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


> My biggest problem is that the user may close the host app 
> while a script is executing.  How should I terminate the 
> script?  Is there a hook that will let me tell Lua to stop 
> interpreting code ASAP and return, much like it does when it 
> encounters a runtime error?  An alterative I've considered is 
> a global 'running' flag which scripts must check periodically 
> to see if they should abort processing (i.e. if not running 
> then return end, or while running do somework() end).
> 
> To complicate matters, I'm using Lua Threads, so a script may 
> have spawned an arbitrary number of child threads.

I'm not sure about Lua Threads, but I do know you can call lua_error()
to dump you out of the currently executing script state.

Josh