From 732507ed3255dff3970c5f92bd6ea13bf877e637 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Thu, 25 Jun 2020 18:11:31 +0200 Subject: [PATCH xserver 2/4] present/wnmd: Free flip_queue entries in present_wnmd_clear_window_flip MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When present_wnmd_clear_window_flip is done, present_destroy_window frees struct present_window_priv, and the events in the flip queue become unreachable. So if we don't free them first, they're leaked. Also drop the call to present_wnmd_set_abort_flip, which just sets a flag in struct present_window_priv and thus can't have any observable effect after present_destroy_window. Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1042 Reviewed-by: Dave Airlie (cherry picked from commit 1bdedc8dbb9d035b85444c2558a137470ff52113) Signed-off-by: Michel Dänzer --- present/present_screen.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/present/present_screen.c b/present/present_screen.c index c435f55f4..bfd30b8ba 100644 --- a/present/present_screen.c +++ b/present/present_screen.c @@ -115,9 +115,9 @@ present_wnmd_clear_window_flip(WindowPtr window) present_window_priv_ptr window_priv = present_window_priv(window); present_vblank_ptr vblank, tmp; - if (window_priv->flip_pending) { - present_wnmd_set_abort_flip(window); - window_priv->flip_pending->window = NULL; + xorg_list_for_each_entry_safe(vblank, tmp, &window_priv->flip_queue, event_queue) { + present_pixmap_idle(vblank->pixmap, vblank->window, vblank->serial, vblank->idle_fence); + present_vblank_destroy(vblank); } xorg_list_for_each_entry_safe(vblank, tmp, &window_priv->idle_queue, event_queue) { -- 2.26.2