edje_lua2: add null check

Summary: It need to check memory allocation failures

Reviewers: Jaehyun_Cho

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D5971

Reviewed-by: Cedric BAIL <cedric@osg.samsung.com>
This commit is contained in:
YeongJong Lee 2018-04-23 13:39:32 -07:00 committed by Cedric BAIL
parent 96ff273449
commit 43c3e68d2f
1 changed files with 5 additions and 0 deletions

View File

@ -3964,6 +3964,11 @@ _edje_lua2_script_init(Edje *ed) // Stack usage [-63, +99, em]
_elua_init(); // This is actually truly pointless, even if raster remembers.
#endif
L = ed->L = luaL_newstate();
if (!L)
{
ERR("Lua state assign failed");
return;
}
al = lua_newuserdata(L, sizeof(Edje_Lua_Allocator));
al->ref = luaL_ref(L, LUA_REGISTRYINDEX);
al->func = lua_getallocf(L, &(al->ud));