Skip to content

Commit

Permalink
virtio-gpu/win32: set the destroy function on load
Browse files Browse the repository at this point in the history
Don't forget to unmap the resource memory.

Fixes: commit 9462ff4 ("virtio-gpu/win32: allocate shareable 2d resources/images")

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
  • Loading branch information
elmarco committed Sep 12, 2023
1 parent 6d8cd7c commit 04562ee
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion hw/display/virtio-gpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1283,7 +1283,9 @@ static int virtio_gpu_load(QEMUFile *f, void *opaque, size_t size,
g_free(res);
return -EINVAL;
}

#ifdef WIN32
pixman_image_set_destroy_function(res->image, win32_pixman_image_destroy, res->handle);
#endif

res->addrs = g_new(uint64_t, res->iov_cnt);
res->iov = g_new(struct iovec, res->iov_cnt);
Expand Down

0 comments on commit 04562ee

Please sign in to comment.