The screen takes ownership of the winsys, and is responsible for
destroying it. Users of pipe-loader should make sure they destory
and screens they've created to avoid memory leaks.
This fixes a crash in clover introduced by
ce6c17c0833032e91a2d1b34f9eb80c738a854a2 where the pipe-loader was
destroying the winsys while a screen was still using it.
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
{
struct pipe_loader_sw_device *sdev = pipe_loader_sw_device(*dev);
- if (sdev->ws && sdev->ws->destroy)
- sdev->ws->destroy(sdev->ws);
-
if (sdev->lib)
util_dl_close(sdev->lib);