From de40d6bae09411bfd30868c94423ddf50bf629de Mon Sep 17 00:00:00 2001
From: cosmonaut <[EMAIL REDACTED]>
Date: Fri, 27 Sep 2024 13:38:02 -0700
Subject: [PATCH] GPU Metal: Set texture to NULL even if
AcquireSwapchainTexture fails
---
src/gpu/metal/SDL_gpu_metal.m | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/gpu/metal/SDL_gpu_metal.m b/src/gpu/metal/SDL_gpu_metal.m
index a9c93d5971e7a..70d59400694db 100644
--- a/src/gpu/metal/SDL_gpu_metal.m
+++ b/src/gpu/metal/SDL_gpu_metal.m
@@ -3598,6 +3598,8 @@ static bool METAL_AcquireSwapchainTexture(
MetalWindowData *windowData;
CGSize drawableSize;
+ *texture = NULL;
+
windowData = METAL_INTERNAL_FetchWindowData(window);
if (windowData == NULL) {
SET_STRING_ERROR_AND_RETURN("Window is not claimed by this SDL_GpuDevice", false);