From d4bd10cb2c43f7e57d5e120457bdc5aa3de2d0b9 Mon Sep 17 00:00:00 2001 From: Ludovic Pouzenc Date: Tue, 16 Jul 2013 21:13:07 +0200 Subject: Ajout d'un appel pour detruire la texture utilisee a la sortie. valgrind truove qd meme des choses a redire, mais il semble que c'est dans la lib, pas dans mon code... --- src/sandbox/sprite.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/sandbox/sprite.c') diff --git a/src/sandbox/sprite.c b/src/sandbox/sprite.c index d624e3e..7aafccf 100644 --- a/src/sandbox/sprite.c +++ b/src/sandbox/sprite.c @@ -75,6 +75,7 @@ int main(int argc, char *argv[]) { SDL_Delay(50); } + SDL_DestroyTexture(t1); SDL_DestroyRenderer(sdl_rend); SDL_DestroyWindow(sdl_win); SDL_Quit(); @@ -97,8 +98,8 @@ void my_SDL_init_or_die(char title[], SDL_Rect win_pos, Uint32 init_flags, Uint3 res=SDL_Init(init_flags); mpl_check( - res==0, - {exit(1);} , // Executed code if expression is not true + res==0, // Expression to evaluate + {exit(1);} , // Code to execute if expression is not true SDL_LOG_PRIORITY_CRITICAL, // SDL_LogPriority (_CRITICAL, _ERROR, _WARN, _INFO, DEBUG, _VERBOSE) "SDL_Init failed (%i)",res // var args list starting with a fmt string like in printf() ); -- cgit v1.2.3