Skip to content
Extraits de code Groupes Projets
Valider 4dc38447 rédigé par Thomas Goyne's avatar Thomas Goyne
Parcourir les fichiers

Check the return value from lua_open()

It always fails when running under valgrind because valgrind does not
implement mmap functionality that LuaJIT requires.
parent bffbae0e
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -46,7 +46,12 @@ int main(int argc, char **argv) { ...@@ -46,7 +46,12 @@ int main(int argc, char **argv) {
// Init lua state // Init lua state
lua_State *L = lua_open(); lua_State *L = lua_open();
agi::lua::preload_modules(L); if (!L) {
fprintf(stderr, "Failed to create Lua state\n");
return 1;
}
preload_modules(L);
Install(L, {"include"}); Install(L, {"include"});
// Build arg table for scripts // Build arg table for scripts
......
...@@ -401,6 +401,7 @@ namespace { ...@@ -401,6 +401,7 @@ namespace {
// create lua environment // create lua environment
L = lua_open(); L = lua_open();
if (!L) return;
bool loaded = false; bool loaded = false;
BOOST_SCOPE_EXIT_ALL(&) { if (!loaded) Destroy(); }; BOOST_SCOPE_EXIT_ALL(&) { if (!loaded) Destroy(); };
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter