summaryrefslogtreecommitdiff
path: root/saa/saa_pixmap.c
diff options
context:
space:
mode:
authorThomas Hellstrom <thellstrom@vmware.com>2018-11-27 08:29:06 +0100
committerThomas Hellstrom <thellstrom@vmware.com>2018-11-29 10:18:39 +0100
commit79d066da48dddcbdfcf41ecbe29cd96aaae2e11c (patch)
tree0db4a0f5e371929181ebb283ec1c40a7daa82f67 /saa/saa_pixmap.c
parent53e87117bbf1cba05a5b5046db9efa961b18fc74 (diff)
saa: Make sure damage destruction happens at the correct location
Incorrect DestroyPixmap wrapping previously made the destruction of damage objects typically happen in damageDestroyPixmap(), leaving a dangling damage pointer in saa_destroy_pixmap() which was only cleared. However in some cases that caused us to leak damage objects. Rework saa initialization somewhat to make sure saa_destroy_pixmap happens before damageDestroyPixmap and destroy the damage object in saa_destroy_pixmap. Also add a damage object destruction notifier callback that clears the saa pixmap damage pointer should the damage object destruction accidentally happen elsewhere. This makes sure we don't leak damage objects. Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Reviewed-by: Deepak Rawat <drawat@vmware.com>
Diffstat (limited to 'saa/saa_pixmap.c')
-rw-r--r--saa/saa_pixmap.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/saa/saa_pixmap.c b/saa/saa_pixmap.c
index 0d63091..240d609 100644
--- a/saa/saa_pixmap.c
+++ b/saa/saa_pixmap.c
@@ -134,7 +134,8 @@ saa_destroy_pixmap(PixmapPtr pPixmap)
REGION_UNINIT(pScreen, &spix->dirty_hw);
REGION_UNINIT(pScreen, &spix->dirty_shadow);
- spix->damage = NULL;
+ if (spix->damage)
+ DamageDestroy(spix->damage);
}
saa_swap(sscreen, pScreen, DestroyPixmap);