client: Don't cancel a roundtrip when any event is received
authorJonas Ådahl <jadahl@gmail.com>
Mon, 26 Nov 2012 22:25:53 +0000 (23:25 +0100)
committerKristian Høgsberg <krh@bitplanet.net>
Tue, 27 Nov 2012 16:09:45 +0000 (11:09 -0500)
commitd7a63fdbfb8fcfcf4b2a81bc4773958ebd785d15
tree7e7964c99b35ebcca4355a36bc96813d68035330
parent5df752ab16f4a343416952ccbc07ab6aa0217429
client: Don't cancel a roundtrip when any event is received

Since wl_display_dispatch() returns the number of processed events or -1
on error, only cancel the roundtrip if an -1 is returned.

This also fixes a potential memory corruption bug happening when
wl_display_roundtrip() does an early return and the callback later
writes to the then out of scope stack allocated `done' parameter.

Introduced by 33b7637b4500a682018b503837b8aca9afae36f2.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
src/wayland-client.c