mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-06 14:43:20 +00:00
Fix memory leak when destroying texture
This commit is contained in:
parent
5b4b4fa1ff
commit
7d5ccae22d
1 changed files with 11 additions and 0 deletions
|
|
@ -678,9 +678,20 @@ static void
|
|||
PS2_DestroyTexture(SDL_Renderer * renderer, SDL_Texture * texture)
|
||||
{
|
||||
GSTEXTURE *ps2_texture = (GSTEXTURE *) texture->driverdata;
|
||||
PS2_RenderData *data = (PS2_RenderData *)renderer->driverdata;
|
||||
|
||||
if (data == 0)
|
||||
return;
|
||||
|
||||
if(ps2_texture == 0)
|
||||
return;
|
||||
|
||||
// Free from vram
|
||||
gsKit_TexManager_free(data->gsGlobal, ps2_texture);
|
||||
|
||||
SDL_free(ps2_texture->Mem);
|
||||
SDL_free(ps2_texture);
|
||||
texture->driverdata = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue