forked from enlightenment/efl
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:
parent
96ff273449
commit
43c3e68d2f
|
@ -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));
|
||||
|
|
Loading…
Reference in New Issue