fix memory leak
This commit is contained in:
parent
33db825d04
commit
4e331c5404
@ -106,7 +106,7 @@ LuaContext LuaRoot::createContext(StringList const& scriptPaths) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
newContext.set("loadstring", m_luaEngine->createFunction([newContext](String const& source, Maybe<String> const& name, Maybe<LuaValue> const& env) -> LuaFunction {
|
newContext.set("loadstring", m_luaEngine->createFunction([&newContext](String const& source, Maybe<String> const& name, Maybe<LuaValue> const& env) -> LuaFunction {
|
||||||
String functionName = name ? strf("loadstring: {}", *name) : "loadstring";
|
String functionName = name ? strf("loadstring: {}", *name) : "loadstring";
|
||||||
return newContext.engine().createFunctionFromSource(newContext.handleIndex(), source.utf8Ptr(), source.utf8Size(), functionName.utf8Ptr());
|
return newContext.engine().createFunctionFromSource(newContext.handleIndex(), source.utf8Ptr(), source.utf8Size(), functionName.utf8Ptr());
|
||||||
}));
|
}));
|
||||||
|
Loading…
Reference in New Issue
Block a user