From 04b127cb702b4dc5a6de835c250135310e7db1f4 Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Wed, 5 Sep 2018 13:08:03 +0200 Subject: [RFC PATCH xserver] xwayland: ignore sync callback if window is destroyed If the window is destroyed, there is no need to send the vblank notify event. This should avoid a crash in present_vblank_notify() if the sync callback is triggered after the Xwayland window is destroyed. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107314 Signed-off-by: Olivier Fourdan --- v2: Don't leak the event. This goes along with https://patchwork.freedesktop.org/patch/247271/ hw/xwayland/xwayland-present.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hw/xwayland/xwayland-present.c b/hw/xwayland/xwayland-present.c index 316e04443..4d65e3807 100644 --- a/hw/xwayland/xwayland-present.c +++ b/hw/xwayland/xwayland-present.c @@ -284,6 +284,10 @@ xwl_present_sync_callback(void *data, return; } + /* Is the window destroyed already ? */ + if (!xwl_present_window) + return; + present_wnmd_event_notify(xwl_present_window->window, event->event_id, xwl_present_window->ust, -- 2.17.1