diff options
author | Michal Suchanek <hramrach@gmail.com> | 2012-03-28 18:12:39 -0700 |
---|---|---|
committer | Jeremy Huddleston <jeremyhu@apple.com> | 2012-04-26 21:07:09 -0700 |
commit | ed33772a0d3ace5844e157ae78885ded000819ea (patch) | |
tree | 2ddde8c15a6ab08daf137528224c53ff334f959d | |
parent | e4dbdee392c78de13fab03c3826f9453f42a8a46 (diff) |
xfree86: workaround crash on close
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=41653
Signed-off-by: Michal Suchanek <hramrach@gmail.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Tested-by: Knut Petersen <Knut_Petersen@t-online.de>
(cherry picked from commit fa6dddc6ce51c1b7a43fb379fb2a19550f6c8683)
-rw-r--r-- | hw/xfree86/modes/xf86Rotate.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/hw/xfree86/modes/xf86Rotate.c b/hw/xfree86/modes/xf86Rotate.c index 85d75573d..cbc868735 100644 --- a/hw/xfree86/modes/xf86Rotate.c +++ b/hw/xfree86/modes/xf86Rotate.c @@ -290,14 +290,19 @@ xf86RotateDestroy(xf86CrtcPtr crtc) * Clean up damage structures when no crtcs are rotated */ if (xf86_config->rotation_damage) { + DrawablePtr screenDrawable = NULL; + if (pScreen && pScreen->root) + screenDrawable = &pScreen->root->drawable; /* Free damage structure */ if (xf86_config->rotation_damage_registered) { - DamageUnregister(&pScreen->root->drawable, - xf86_config->rotation_damage); + if (screenDrawable) + DamageUnregister(screenDrawable, + xf86_config->rotation_damage); xf86_config->rotation_damage_registered = FALSE; DisableLimitedSchedulingLatency(); } - DamageDestroy(xf86_config->rotation_damage); + if (screenDrawable) + DamageDestroy(xf86_config->rotation_damage); xf86_config->rotation_damage = NULL; } } |