lua-users home
lua-l archive

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

On Mon, Dec 14, 2009 at 8:57 PM, Raymond Jacobs <> wrote:
I wanted to point out that I am having an issue using mochalua;
I see folks talking about it here occasionally so maybe someone can shed some light.

I was running into an issue where I would first create a lua_State, then execute luaL_openlibs;

however if you subsequently create a new lua_State and execute luaL_openlibs again; it fails to open the libs in the new state.

after a lot of digging, i found that the lua_registry is implemented as a static 'global' in class LVM;
 meaning that the registry seems to maintain knowledge beyond a lua_State;

it keeps the knowledge that I've previously loaded the libraries and so doesnt load them properly again; at least that is my best guess.

has anyone ran into such an issue?  and perhaps has a workaround?

unfortunetly the class LVM is not publicly accesable so I can't manually reset m_registry; unless I compile it from source which I may have to.

there also seems to be a reinit() function defined in LVM; this seems to show that there was intent to allow resetting of this.

if any more information is needed please let me know.

Raymond Jacobs
Ethereal Darkness Interactive

After managing to change the access of class LVM to public; and calling LVM.reinit(); this solves the issue
however having the lua registry being the same and persistent for all states ever created is sure to cause some problems.