mirror of
https://github.com/X11Libre/xserver.git
synced 2026-04-14 17:18:09 +00:00
Fixes: 1530c7de53 (use-after-free)
The reason I moved this to PostCloseScreen is that glamor provides the function `glamor_egl_get_gbm_device`.
This function returns the gbm device that glamor creates.
Drivers (notably modesetting) can then use this gbm device to create bo's for whatever they need.
Since glamor's gbm device remains owned by glamor, it must only get freed
after the driver finishes freeing the bo's it created.
As such, glamor_egl's `closeScreen` must be called after the driver's `closeScreen`,
because otherwise, if we free the gbm device before freeing the bo's,
then when the bo's are freed, we will have an use-after-free.
Signed-off-by: stefan11111 <stefan11111@shitposting.expert>