freedreno: fix device close issues

Move closing the fd to after subclass ->destroy() (since it might want
to delete gem bo's, etc), and actually free() the fd_device object.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
main
Rob Clark 2017-03-23 14:58:38 -04:00
parent d0dae26ca4
commit a07ae97c75
1 changed files with 2 additions and 1 deletions

View File

@ -115,9 +115,10 @@ static void fd_device_del_impl(struct fd_device *dev)
fd_bo_cache_cleanup(&dev->bo_cache, 0);
drmHashDestroy(dev->handle_table);
drmHashDestroy(dev->name_table);
dev->funcs->destroy(dev);
if (dev->closefd)
close(dev->fd);
dev->funcs->destroy(dev);
free(dev);
}
drm_private void fd_device_del_locked(struct fd_device *dev)