Recommended Posts

I am having a very strange problem, LUA is crashing my program. Now, that isn't the strange part. The strange part is that the code I am using in another program works without problems, but when added to my engine I get this:
Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object.
at fputs(SByte* , _iobuf* )
at ?A0x4c700a50.luaB_print(lua_State* L)
at luaD_precall(lua_State* L, lua_TObject* func)
at luaV_execute(lua_State* L)
at luaD_call(lua_State* L, lua_TObject* func, Int32 nResults)
at ?A0x4f8a2daa.f_call(lua_State* L, Void* ud)
at luaD_rawrunprotected(lua_State* , IntPtr , Void* )
at luaD_pcall(lua_State* L, IntPtr func, Void* u, Int32 oldtop, Int32 ef)
at lua_pcall(lua_State* L, Int32 nargs, Int32 nresults, Int32 errfunc)
at ?A0x0a637578.aux_do(lua_State* L, Int32 status)
at lua_dofile(lua_State* L, SByte* filename)
I run everything through a gameManager, and inside that is the luaMgr that handles LUA. So, in main I call gameManager->luaMgr->LuaCreateState(); (which does more then just creating states, I moved everything into it for simplicity and for it to be EXACTLY like my test program. LuaCreateState() contains this: