mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-02-16 00:24:04 +00:00
Don't do NULL-checks before SDL_free()
Replaces the pattern
if (ptr) {
SDL_free(ptr);
}
with
SDL_free(ptr);
This commit is contained in:
committed by
Sam Lantinga
parent
2f810e0a5f
commit
aaee09d6ed
@@ -4958,9 +4958,7 @@ static void VULKAN_DestroyDevice(
|
||||
j);
|
||||
}
|
||||
|
||||
if (renderer->memoryAllocator->subAllocators[i].allocations != NULL) {
|
||||
SDL_free(renderer->memoryAllocator->subAllocators[i].allocations);
|
||||
}
|
||||
SDL_free(renderer->memoryAllocator->subAllocators[i].allocations);
|
||||
|
||||
SDL_free(renderer->memoryAllocator->subAllocators[i].sortedFreeRegions);
|
||||
}
|
||||
@@ -6987,9 +6985,7 @@ static void VULKAN_ReleaseTexture(
|
||||
SDL_DestroyProperties(vulkanTextureContainer->header.info.props);
|
||||
|
||||
// Containers are just client handles, so we can destroy immediately
|
||||
if (vulkanTextureContainer->debugName != NULL) {
|
||||
SDL_free(vulkanTextureContainer->debugName);
|
||||
}
|
||||
SDL_free(vulkanTextureContainer->debugName);
|
||||
SDL_free(vulkanTextureContainer->textures);
|
||||
SDL_free(vulkanTextureContainer);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user