libdrm/iris: free objects in Drm_call destructor

Make sure to remove all buffers, sync objects, and contexts during
destruction.

Fixes #4466
This commit is contained in:
Sebastian Sumpf 2022-03-31 14:14:17 +02:00 committed by Christian Helmuth
parent d4390adb68
commit f085fc9dd2

View File

@ -1247,6 +1247,21 @@ class Drm_call
Genode::warning("syncobject 0 not reserved");
}
~Drm_call()
{
while(_buffer_space.apply_any<Buffer>([&] (Buffer &buffer) {
_free_buffer(buffer.id());
}));
while (_context_space.apply_any<Drm::Context>([&] (Drm::Context &context) {
Libc::close(context.fd());
destroy(_heap, &context);
}));
while (_sync_objects.apply_any<Sync_obj>([&] (Sync_obj &obj) {
destroy(_heap, &obj); }));
}
int lseek(int fd, off_t offset, int whence)
{
if (fd != prime_fd || offset || whence != SEEK_END)