SDL: vulkan: Fix double vkDestroyImage when texture memory binding fails

From 6331d35c41d08cb3fca4ff5da0a20e0e211e7e3c Mon Sep 17 00:00:00 2001
From: Mateusz Garbowski <[EMAIL REDACTED]>
Date: Sat, 17 Oct 2026 23:45:43 +0200
Subject: [PATCH] vulkan: Fix double vkDestroyImage when texture memory binding
 fails

VULKAN_INTERNAL_CreateTexture destroyed texture->image and then called
VULKAN_INTERNAL_DestroyTexture, which destroys texture->image again.
---
 src/gpu/vulkan/SDL_gpu_vulkan.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/src/gpu/vulkan/SDL_gpu_vulkan.c b/src/gpu/vulkan/SDL_gpu_vulkan.c
index f69e810fc2da2..15d518bd3a909 100644
--- a/src/gpu/vulkan/SDL_gpu_vulkan.c
+++ b/src/gpu/vulkan/SDL_gpu_vulkan.c
@@ -5839,11 +5839,6 @@ static VulkanTexture *VULKAN_INTERNAL_CreateTexture(
         &texture->usedRegion);
 
     if (bindResult != 1) {
-        renderer->vkDestroyImage(
-            renderer->logicalDevice,
-            texture->image,
-            NULL);
-
         VULKAN_INTERNAL_DestroyTexture(renderer, texture);
         SET_STRING_ERROR_AND_RETURN("Unable to bind memory for texture!", NULL);
     }