Fix stack handling on errors for the mouse grabber
This one actually uses the return value from the function (where's the consistency?!), so the code is fixed to only pop the return value if there is actually one. Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
parent
b59b28f716
commit
2d8421730b
7
event.c
7
event.c
|
@ -122,10 +122,11 @@ event_handle_mousegrabber(int x, int y, uint16_t mask)
|
|||
{
|
||||
warn("Stopping mousegrabber.");
|
||||
luaA_mousegrabber_stop(L);
|
||||
} else {
|
||||
if(!lua_isboolean(L, -1) || !lua_toboolean(L, -1))
|
||||
luaA_mousegrabber_stop(L);
|
||||
lua_pop(L, 1); /* pop returned value */
|
||||
}
|
||||
else if(!lua_isboolean(L, -1) || !lua_toboolean(L, -1))
|
||||
luaA_mousegrabber_stop(L);
|
||||
lua_pop(L, 1); /* pop returned value */
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
Loading…
Reference in New Issue