summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2016-07-26 17:28:33 +0900
committerMichel Dänzer <michel@daenzer.net>2016-07-28 10:12:44 +0900
commit0924ac014d7caadab0b15ba69cd0a09cfe8a01da (patch)
tree74a2de448dcd4cc76813e715a99349247c3d6537
parentb4e46c0444bb09f4af59d9d13acc939a0fbbc6d6 (diff)
present: Only call restore_screen_pixmap once from set_abort_flip
present_restore_screen_pixmap's work doesn't need to be done several times for the same pending flip. Fixes a crash if the X server quits while a flip is pending, in which case present_set_abort_flip may be called several times, including when screen->root is already cleared to NULL. Reviewed-by: Hans de Goede <hdegoede@redhat.com>
-rw-r--r--present/present.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/present/present.c b/present/present.c
index 521083287..5fde84626 100644
--- a/present/present.c
+++ b/present/present.c
@@ -455,9 +455,10 @@ present_set_abort_flip(ScreenPtr screen)
{
present_screen_priv_ptr screen_priv = present_screen_priv(screen);
- present_restore_screen_pixmap(screen);
-
- screen_priv->flip_pending->abort_flip = TRUE;
+ if (!screen_priv->flip_pending->abort_flip) {
+ present_restore_screen_pixmap(screen);
+ screen_priv->flip_pending->abort_flip = TRUE;
+ }
}
static void