# SDL: GPU D3D12: Fix command buffer leak

**URL:** <https://discourse.libsdl.org/t/sdl-gpu-d3d12-fix-command-buffer-leak/53879>\
**Category:** SDL Commits\
**Created:** [August 30, 2024, 5:48pm UTC](https://discourse.libsdl.org/t/sdl-gpu-d3d12-fix-command-buffer-leak/53879 "2024-08-30T17:48:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![SDLPushPostBot](https://discourse.libsdl.org/user_avatar/discourse.libsdl.org/sdlpushpostbot/32/4370_2.png) [@SDLPushPostBot](https://discourse.libsdl.org/u/SDLPushPostBot)\
**Post date:** [August 30, 2024, 5:48pm UTC](https://discourse.libsdl.org/t/sdl-gpu-d3d12-fix-command-buffer-leak/53879/1 "2024-08-30T17:48:01Z")

</div>

> <https://github.com/libsdl-org/SDL/commit/906044569d9e132f6b18b33aae69f7de30a164fb>

```diff
From 906044569d9e132f6b18b33aae69f7de30a164fb Mon Sep 17 00:00:00 2001
From: cosmonaut <[EMAIL REDACTED]>
Date: Fri, 30 Aug 2024 10:29:56 -0700
Subject: [PATCH] GPU D3D12: Fix command buffer leak

---
 src/gpu/d3d12/SDL_gpu_d3d12.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/gpu/d3d12/SDL_gpu_d3d12.c b/src/gpu/d3d12/SDL_gpu_d3d12.c
index 4c40e46d04c92..7e3c1be0b73ac 100644
--- a/src/gpu/d3d12/SDL_gpu_d3d12.c
+++ b/src/gpu/d3d12/SDL_gpu_d3d12.c
@@ -1230,6 +1230,7 @@ static void D3D12_INTERNAL_DestroyCommandBuffer(D3D12CommandBuffer *commandBuffe
     SDL_free(commandBuffer->usedGraphicsPipelines);
     SDL_free(commandBuffer->usedComputePipelines);
     SDL_free(commandBuffer->usedUniformBuffers);
+ SDL_free(commandBuffer->textureDownloads);
     SDL_free(commandBuffer);
 }
 

```
