Fix potential memory leak in VULKAN_AcquireCommandBuffer() on error#15142
Conversation
|
It's a good practice to check for allocation results immediately after allocation, but in this case I think checking after the natural unlock is harmless. @flibitijibibo, thoughts? |
If the check is done after the natural unlock and |
flibitijibibo
left a comment
There was a problem hiding this comment.
This makes sense - the only real functional change is preventing a leak, and the normal scenario won't behave any differently here.
|
Merged, thanks! |
Moving the
commandBufferNULLcheck above theVULKAN_INTERNAL_AcquireDescriptorSetCache()call.VULKAN_INTERNAL_AcquireDescriptorSetCache()allocates memory or gets adescriptorSetCachefrom a pool and returns it, which would be unused ifcommandBufferisNULL:SDL/src/gpu/vulkan/SDL_gpu_vulkan.c
Lines 5018 to 5025 in fb1d1ab
Warning