summaryrefslogtreecommitdiff
path: root/indra/llcommon/lua_function.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llcommon/lua_function.cpp')
-rw-r--r--indra/llcommon/lua_function.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/indra/llcommon/lua_function.cpp b/indra/llcommon/lua_function.cpp
index 17d81e8fc7..e9b4bf0b89 100644
--- a/indra/llcommon/lua_function.cpp
+++ b/indra/llcommon/lua_function.cpp
@@ -406,9 +406,14 @@ void lua_pushllsd(lua_State* L, const LLSD& data)
}
LuaState::LuaState(script_finished_fn cb):
- mCallback(cb),
- mState(luaL_newstate())
+ mCallback(cb)
{
+ initLuaState();
+}
+
+void LuaState::initLuaState()
+{
+ mState = luaL_newstate();
luaL_openlibs(mState);
LuaFunction::init(mState);
// Try to make print() write to our log.