[PATCH 3/4] present: Avoid crash at server shutdown

Keith Packard keithp at keithp.com
Thu Jul 24 16:39:20 PDT 2014


When a present flip operation is still in process during server reset,
the call to present_set_abort_flip may not happen until the screen is
being closed, at which point there is no root window to set pixmaps
for. Check to make sure there's a window before resetting window pixmaps.

Signed-off-by: Keith Packard <keithp at keithp.com>
---
 present/present.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/present/present.c b/present/present.c
index f624e5b..f488e21 100644
--- a/present/present.c
+++ b/present/present.c
@@ -399,7 +399,8 @@ present_set_abort_flip(ScreenPtr screen)
         present_set_tree_pixmap(screen_priv->flip_window,
                                   (*screen->GetScreenPixmap)(screen));
 
-    present_set_tree_pixmap(screen->root, (*screen->GetScreenPixmap)(screen));
+    if (screen->root)
+        present_set_tree_pixmap(screen->root, (*screen->GetScreenPixmap)(screen));
 
     screen_priv->flip_pending->abort_flip = TRUE;
 }
-- 
2.0.1



More information about the xorg-devel mailing list