mirror of
https://github.com/X11Libre/xf86-video-vmware.git
synced 2026-03-24 01:24:37 +00:00
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>