update anti leak
This commit is contained in:
+14
-2
@@ -6,7 +6,7 @@
|
||||
/* By: yantoine <yantoine@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/02/17 19:22:27 by yantoine #+# #+# */
|
||||
/* Updated: 2025/02/24 17:01:54 by yantoine ### ########.fr */
|
||||
/* Updated: 2025/02/25 00:15:35 by yantoine ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@@ -17,13 +17,25 @@ int key_press(int keycode, t_app *app)
|
||||
(void)app;
|
||||
printf("keycode: %d\n", keycode);
|
||||
if (keycode == 53 || keycode == 65307)
|
||||
{
|
||||
mlx_destroy_image(app->mlx, app->img);
|
||||
mlx_destroy_window(app->mlx, app->win);
|
||||
mlx_destroy_display(app->mlx);
|
||||
free(app->mlx);
|
||||
exit(0);
|
||||
}
|
||||
return (0);
|
||||
}
|
||||
|
||||
int handle_close(void *param)
|
||||
{
|
||||
(void)param;
|
||||
t_app *app;
|
||||
|
||||
app = (t_app *)param;
|
||||
mlx_destroy_image(app->mlx, app->img);
|
||||
mlx_destroy_window(app->mlx, app->win);
|
||||
mlx_destroy_display(app->mlx);
|
||||
free(app->mlx);
|
||||
exit(0);
|
||||
return (0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user