mirror of https://github.com/mpv-player/mpv
lua: complain loudly if Lua state creation fails
This should normally happen only if memory allocation for the state happens, which should be extremely rare. But with Luajit on OSX, it can happen if the magic compiler flags required by Luajit were not passed to mpv compilation. Print an error to reduce confusion.
This commit is contained in:
parent
733218b233
commit
cad6fb038b
|
@ -377,8 +377,10 @@ static int load_lua(struct mpv_handle *client, const char *fname)
|
|||
}
|
||||
|
||||
lua_State *L = ctx->state = luaL_newstate();
|
||||
if (!L)
|
||||
if (!L) {
|
||||
MP_FATAL(ctx, "Could not initialize Lua.\n");
|
||||
goto error_out;
|
||||
}
|
||||
|
||||
if (mp_cpcall(L, run_lua, ctx)) {
|
||||
const char *err = "unknown error";
|
||||
|
|
Loading…
Reference in New Issue