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>
This commit is contained in:
Keith Packard 2014-07-20 18:57:42 -07:00
parent 627bce8089
commit 40dc81154a

View File

@ -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;
}