summaryrefslogtreecommitdiff
path: root/present
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2014-07-20 18:57:42 -0700
committerKeith Packard <keithp@keithp.com>2014-07-31 00:03:55 -0700
commit40dc81154ad38514793f2181447d597b57d39e80 (patch)
treea95552c79c90cbec86d5c80e9b14bab592882cf0 /present
parent627bce80894647c681b146a709aad4c390b4374e (diff)
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 <keithp@keithp.com> Reviewed-by: Eric Anholt <eric@anholt.net>
Diffstat (limited to 'present')
-rw-r--r--present/present.c3
1 files changed, 2 insertions, 1 deletions
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;
}