From 64c959e46c7a04aba4853173fe35edb033eb07cd Mon Sep 17 00:00:00 2001 From: Tatsuyuki Ishi Date: Tue, 27 Jun 2023 21:20:38 +0900 Subject: [PATCH] vulkan/pipeline_cache: Do not consume object passed into remove_object. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Future use case will require removing an object with zero ref count, so leave it up to the caller to call unref. Reviewed-by: Daniel Schürmann Part-of: --- src/vulkan/runtime/vk_pipeline_cache.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/vulkan/runtime/vk_pipeline_cache.c b/src/vulkan/runtime/vk_pipeline_cache.c index bb6e472688d..f86667f2e77 100644 --- a/src/vulkan/runtime/vk_pipeline_cache.c +++ b/src/vulkan/runtime/vk_pipeline_cache.c @@ -164,9 +164,6 @@ vk_pipeline_cache_remove_object(struct vk_pipeline_cache *cache, _mesa_set_remove(cache->object_cache, entry); } vk_pipeline_cache_unlock(cache); - - /* Drop our reference */ - vk_pipeline_cache_object_unref(cache->base.device, object); } static bool @@ -367,6 +364,7 @@ vk_pipeline_cache_lookup_object(struct vk_pipeline_cache *cache, "Deserializing pipeline cache object failed"); vk_pipeline_cache_remove_object(cache, hash, object); + vk_pipeline_cache_object_unref(cache->base.device, object); return NULL; }