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>
This commit is contained in:
Michal Suchanek 2012-03-28 18:12:39 -07:00 committed by Jeremy Huddleston
parent adcb48a29d
commit fa6dddc6ce

View File

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