From cccb3bdf6b6196cf198be8c6d189daf495db3788 Mon Sep 17 00:00:00 2001 From: Aubin DORIVAL Date: Mon, 16 Dec 2024 21:50:56 +0100 Subject: [PATCH] fix memory leak --- display.c | 1 + function.c | 1 + 2 files changed, 2 insertions(+) diff --git a/display.c b/display.c index 6b04196..7bc597f 100644 --- a/display.c +++ b/display.c @@ -168,4 +168,5 @@ void displayTextSDL (dis *display_user, char *text, vect coor, vect size, SDL_FreeSurface (surface_text); SDL_DestroyTexture (message); + TTF_CloseFont(Sans); } diff --git a/function.c b/function.c index 73f53ee..7fade0e 100644 --- a/function.c +++ b/function.c @@ -275,6 +275,7 @@ void inGameLoop (unsigned short int **tab2d, int N, vect *playerPos, char *char_time = timeToText (time(NULL) - time_start); displayTextSDL (display_user, char_time, coor_time, size_menu, 50); + free(char_time); } SDL_Delay (16);