mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-16 19:18:55 +00:00
gpu renderer: fixed memory leak when resizing the backbuffer
Fixes https://github.com/libsdl-org/SDL/issues/14734
(cherry picked from commit 9698e20399)
This commit is contained in:
parent
6034cf5cd8
commit
5afbd85755
1 changed files with 2 additions and 0 deletions
|
|
@ -940,6 +940,8 @@ static bool CreateBackbuffer(GPU_RenderData *data, Uint32 w, Uint32 h, SDL_GPUTe
|
|||
tci.sample_count = SDL_GPU_SAMPLECOUNT_1;
|
||||
tci.usage = SDL_GPU_TEXTUREUSAGE_COLOR_TARGET | SDL_GPU_TEXTUREUSAGE_SAMPLER;
|
||||
|
||||
SDL_ReleaseGPUTexture(data->device, data->backbuffer.texture);
|
||||
|
||||
data->backbuffer.texture = SDL_CreateGPUTexture(data->device, &tci);
|
||||
data->backbuffer.width = w;
|
||||
data->backbuffer.height = h;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue