server: stop wl_display_run() on dispatch error

If wl_event_loop_dispatch() fails, we could enter an infinite loop,
repeatedly calling a failing wl_event_loop_dispatch() forever.

Signed-off-by: Simon Ser <contact@emersion.fr>
This commit is contained in:
Simon Ser 2023-04-18 17:44:47 +02:00
parent 0e0ae7e290
commit 8f2a33cffc

View File

@ -1490,7 +1490,9 @@ wl_display_run(struct wl_display *display)
while (display->run) { while (display->run) {
wl_display_flush_clients(display); wl_display_flush_clients(display);
wl_event_loop_dispatch(display->loop, -1); if (wl_event_loop_dispatch(display->loop, -1) < 0) {
break;
}
} }
} }