From 8809ce564862d19fcc466af846f9a7dd94069e35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Manuel=20J=C3=A1quez=20Leal?= Date: Wed, 28 Jun 2023 19:38:33 +0200 Subject: [PATCH] vkmemory: unref queue in barriers Queue might be assigned for queue transfers, so we need to unref it if the memory has been assigned to a specific queue. Part-of: --- .../gst-plugins-bad/gst-libs/gst/vulkan/gstvkbuffermemory.c | 2 ++ .../gst-plugins-bad/gst-libs/gst/vulkan/gstvkimagememory.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkbuffermemory.c b/subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkbuffermemory.c index cf4040fd7f..8688582009 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkbuffermemory.c +++ b/subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkbuffermemory.c @@ -271,6 +271,8 @@ _vk_buffer_mem_free (GstAllocator * allocator, GstMemory * memory) if (mem->buffer && !mem->wrapped) vkDestroyBuffer (mem->device->device, mem->buffer, NULL); + gst_clear_object (&mem->barrier.parent.queue); + if (mem->vk_mem) gst_memory_unref ((GstMemory *) mem->vk_mem); diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkimagememory.c b/subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkimagememory.c index de22939a13..8db32a6973 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkimagememory.c +++ b/subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkimagememory.c @@ -366,6 +366,8 @@ _vk_image_mem_free (GstAllocator * allocator, GstMemory * memory) if (mem->image && !mem->wrapped) vkDestroyImage (mem->device->device, mem->image, NULL); + gst_clear_object (&mem->barrier.parent.queue); + if (mem->vk_mem) gst_memory_unref ((GstMemory *) mem->vk_mem);