Commit 2a70d492f008b15b924041f07886e56ab44dcfb9

Francisco Javier Trujillo Mata 2022-07-07T16:42:42

Destroy texture properly

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
diff --git a/src/render/ps2/SDL_render_ps2.c b/src/render/ps2/SDL_render_ps2.c
index b590388..9c5b0e5 100644
--- a/src/render/ps2/SDL_render_ps2.c
+++ b/src/render/ps2/SDL_render_ps2.c
@@ -465,9 +465,10 @@ PS2_RenderPresent(SDL_Renderer * renderer)
 static void
 PS2_DestroyTexture(SDL_Renderer * renderer, SDL_Texture * texture)
 {
-    SDL_Surface *surface = (SDL_Surface *) texture->driverdata;
+    GSTEXTURE *ps2_texture = (GSTEXTURE *) texture->driverdata;
 
-    SDL_FreeSurface(surface);
+    SDL_free(ps2_texture->Mem);
+    SDL_free(ps2_texture);
 }
 
 static void