|
Sorry if I misunderstand, but isn't this all you want?lua_pushnil(MainState);
lua_getfield(MainState, LUA_GLOBALSINDEX, "ThreadTable");
lua_rawseti(MainState, -2, refID);
lua_pop(MainState, 1); /* ThreadTable */
On Tue, Oct 6, 2009 at 9:48 PM, Chris Gagnon <cgagnon@zindagigames.com> wrote:[...]
> Apologizes for the partial email, what a way to introduce myself ;o)
>
> Lets assume we have a MainState, and a "ThreadTable" in the global table
>
> lua_getfield(MainState, LUA_GLOBALSINDEX, "ThreadTable");
> lua_State *thread = lua_newthread(MainState);
> int refID = luaL_ref(MainState, -2);
> lua_pop(MainState,1);
> The problem i'm running into is how do I remove my reference/anchor, whenSorry if I misunderstand, but isn't this all you want?
> the coroutine is simply done.
lua_pushnil(MainState);
lua_getfield(MainState, LUA_GLOBALSINDEX, "ThreadTable");
lua_rawseti(MainState, -2, refID);
lua_pop(MainState, 1); /* ThreadTable */
--
-Patrick Donnelly
"Let all men know thee, but no man know thee thoroughly: Men freely
ford that see the shallows."
- Benjamin Franklin