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:
parent
adcb48a29d
commit
fa6dddc6ce
|
@ -290,14 +290,19 @@ xf86RotateDestroy(xf86CrtcPtr crtc)
|
||||||
* Clean up damage structures when no crtcs are rotated
|
* Clean up damage structures when no crtcs are rotated
|
||||||
*/
|
*/
|
||||||
if (xf86_config->rotation_damage) {
|
if (xf86_config->rotation_damage) {
|
||||||
|
DrawablePtr screenDrawable = NULL;
|
||||||
|
if (pScreen && pScreen->root)
|
||||||
|
screenDrawable = &pScreen->root->drawable;
|
||||||
/* Free damage structure */
|
/* Free damage structure */
|
||||||
if (xf86_config->rotation_damage_registered) {
|
if (xf86_config->rotation_damage_registered) {
|
||||||
DamageUnregister(&pScreen->root->drawable,
|
if (screenDrawable)
|
||||||
xf86_config->rotation_damage);
|
DamageUnregister(screenDrawable,
|
||||||
|
xf86_config->rotation_damage);
|
||||||
xf86_config->rotation_damage_registered = FALSE;
|
xf86_config->rotation_damage_registered = FALSE;
|
||||||
DisableLimitedSchedulingLatency();
|
DisableLimitedSchedulingLatency();
|
||||||
}
|
}
|
||||||
DamageDestroy(xf86_config->rotation_damage);
|
if (screenDrawable)
|
||||||
|
DamageDestroy(xf86_config->rotation_damage);
|
||||||
xf86_config->rotation_damage = NULL;
|
xf86_config->rotation_damage = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue