mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-14 02:27:39 -04:00
lua Fix a few potential bugs
Change-Id: I0293371c58f1ca2d148b3b1e1f780cf76f312ef9
This commit is contained in:
parent
aad15d5cd7
commit
8c36d8b131
3 changed files with 10 additions and 3 deletions
|
@ -803,8 +803,10 @@ static int panic (lua_State *L) {
|
|||
|
||||
LUALIB_API lua_State *luaL_newstate (void) {
|
||||
lua_State *L = lua_newstate(l_alloc, NULL);
|
||||
lua_setallocf(L, l_alloc, L); /* allocator needs lua_State. */
|
||||
if (L) lua_atpanic(L, &panic);
|
||||
if (L){
|
||||
lua_setallocf(L, l_alloc, L); /* allocator needs lua_State. */
|
||||
lua_atpanic(L, &panic);
|
||||
}
|
||||
return L;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue