Skip to content

Handle cleaning up of commandPool which caused memory leak when resizing - #16331

Merged
slouken merged 1 commit into
libsdl-org:mainfrom
wwsmiff:main
Sep 16, 2026
Merged

slouken merged 1 commit into
libsdl-org:mainfrom
wwsmiff:main

Conversation

@wwsmiff

@wwsmiff wwsmiff commented Sep 16, 2026

Copy link
Copy Markdown
Contributor
  • I confirm that I am the author of this code and release it to the SDL project under the zlib license. This contribution does not contain code from other sources, including code generated by a Large Language Model ("AI").

This fixes a memory leak that happens when resizing a window that uses the SDL renderer with a vulkan backend.

Description

The leak happened due to improperly cleaning up resources within VULKAN_CreateSwapChain, specifically, it did not destroy the commandPool and instead only resets it but later creates a new one instead of reusing the old one. This was fixed by changing vkResetCommandPool to vkFreeCommandBuffers and this fixes the memory leak.

Existing Issue(s)

Fixes #14973

@slouken
slouken merged commit ff19a49 into libsdl-org:main Sep 16, 2026
1 check passed
@slouken slouken modified the milestones: 3.6.0, 3.4.18 Sep 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2D rendering memory leak

2 participants