From 40dc81154ad38514793f2181447d597b57d39e80 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sun, 20 Jul 2014 18:57:42 -0700 Subject: present: Avoid crash at server shutdown 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 Reviewed-by: Eric Anholt --- present/present.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'present') diff --git a/present/present.c b/present/present.c index f624e5b7b..f488e21cc 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; } -- cgit v1.2.3