From ef58dd77ca656674c54ceda48428ac97a3dd49bc Mon Sep 17 00:00:00 2001
From: Evan Hemsley <[EMAIL REDACTED]>
Date: Thu, 17 Jul 2025 00:21:34 -0700
Subject: [PATCH] GPU: Clean up properties in SDL_ReleaseGPUTexture (#13378)
---
src/gpu/d3d12/SDL_gpu_d3d12.c | 2 ++
src/gpu/metal/SDL_gpu_metal.m | 1 +
src/gpu/vulkan/SDL_gpu_vulkan.c | 2 ++
3 files changed, 5 insertions(+)
diff --git a/src/gpu/d3d12/SDL_gpu_d3d12.c b/src/gpu/d3d12/SDL_gpu_d3d12.c
index a92215910c109..ef9c924cfdbfd 100644
--- a/src/gpu/d3d12/SDL_gpu_d3d12.c
+++ b/src/gpu/d3d12/SDL_gpu_d3d12.c
@@ -1441,6 +1441,8 @@ static void D3D12_INTERNAL_ReleaseTextureContainer(
container->textures[i]);
}
+ SDL_DestroyProperties(container->header.info.props);
+
// Containers are just client handles, so we can destroy immediately
if (container->debugName) {
SDL_free(container->debugName);
diff --git a/src/gpu/metal/SDL_gpu_metal.m b/src/gpu/metal/SDL_gpu_metal.m
index 7c2aefebb2c63..591bd052afb42 100644
--- a/src/gpu/metal/SDL_gpu_metal.m
+++ b/src/gpu/metal/SDL_gpu_metal.m
@@ -888,6 +888,7 @@ static void METAL_INTERNAL_DestroyTextureContainer(
container->textures[i]->handle = nil;
SDL_free(container->textures[i]);
}
+ SDL_DestroyProperties(container->header.info.props);
if (container->debugName != NULL) {
SDL_free(container->debugName);
}
diff --git a/src/gpu/vulkan/SDL_gpu_vulkan.c b/src/gpu/vulkan/SDL_gpu_vulkan.c
index b9ee539ec431f..4fc5a71b7c053 100644
--- a/src/gpu/vulkan/SDL_gpu_vulkan.c
+++ b/src/gpu/vulkan/SDL_gpu_vulkan.c
@@ -6951,6 +6951,8 @@ static void VULKAN_ReleaseTexture(
VULKAN_INTERNAL_ReleaseTexture(renderer, vulkanTextureContainer->textures[i]);
}
+ SDL_DestroyProperties(vulkanTextureContainer->header.info.props);
+
// Containers are just client handles, so we can destroy immediately
if (vulkanTextureContainer->debugName != NULL) {
SDL_free(vulkanTextureContainer->debugName);