mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-22 14:01:55 +00:00
Fix potential memory leak in VULKAN_AcquireCommandBuffer() on error
(cherry picked from commit 77f4a8e2b8)
This commit is contained in:
parent
fb9bb7426d
commit
8bf6e23164
1 changed files with 5 additions and 4 deletions
|
|
@ -9499,15 +9499,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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue