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
5
event.c
5
event.c
|
@ -122,10 +122,11 @@ event_handle_mousegrabber(int x, int y, uint16_t mask)
|
||||||
{
|
{
|
||||||
warn("Stopping mousegrabber.");
|
warn("Stopping mousegrabber.");
|
||||||
luaA_mousegrabber_stop(L);
|
luaA_mousegrabber_stop(L);
|
||||||
}
|
} else {
|
||||||
else if(!lua_isboolean(L, -1) || !lua_toboolean(L, -1))
|
if(!lua_isboolean(L, -1) || !lua_toboolean(L, -1))
|
||||||
luaA_mousegrabber_stop(L);
|
luaA_mousegrabber_stop(L);
|
||||||
lua_pop(L, 1); /* pop returned value */
|
lua_pop(L, 1); /* pop returned value */
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in New Issue