From: Marc-André Lureau Date: Wed, 6 Sep 2023 12:37:43 +0000 (+0400) Subject: virtio-gpu/win32: set the destroy function on load X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=04562ee88e99d71f4e6017f64123f726dd8b41e1;p=qemu.git virtio-gpu/win32: set the destroy function on load Don't forget to unmap the resource memory. Fixes: commit 9462ff469 ("virtio-gpu/win32: allocate shareable 2d resources/images") Signed-off-by: Marc-André Lureau --- diff --git a/hw/display/virtio-gpu.c b/hw/display/virtio-gpu.c index bbd5c6561a..93857ad523 100644 --- a/hw/display/virtio-gpu.c +++ b/hw/display/virtio-gpu.c @@ -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);