mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-03-09 18:45:35 +00:00
Fix potential memory leak in VULKAN_AcquireCommandBuffer() on error
This commit is contained in:
committed by
Sam Lantinga
parent
fb1d1ab306
commit
77f4a8e2b8
@@ -9548,15 +9548,16 @@ static SDL_GPUCommandBuffer *VULKAN_AcquireCommandBuffer(
|
||||
VulkanCommandBuffer *commandBuffer =
|
||||
VULKAN_INTERNAL_GetInactiveCommandBufferFromPool(renderer, threadID);
|
||||
|
||||
if (commandBuffer == NULL) {
|
||||
SDL_UnlockMutex(renderer->acquireCommandBufferLock);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
DescriptorSetCache *descriptorSetCache =
|
||||
VULKAN_INTERNAL_AcquireDescriptorSetCache(renderer);
|
||||
|
||||
SDL_UnlockMutex(renderer->acquireCommandBufferLock);
|
||||
|
||||
if (commandBuffer == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
commandBuffer->descriptorSetCache = descriptorSetCache;
|
||||
|
||||
// Reset state
|
||||
|
||||
Reference in New Issue
Block a user