mirror of
https://codeberg.org/ACME-Corporation/cub3d.git
synced 2025-12-06 09:58:09 +01:00
fix: fixed texture leakage
This commit is contained in:
parent
ecb99e4840
commit
87c0a8a991
1 changed files with 5 additions and 1 deletions
|
|
@ -6,7 +6,7 @@
|
|||
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/08/18 13:05:31 by kcolin #+# #+# */
|
||||
/* Updated: 2025/09/08 17:02:43 by tchampio ### ########.fr */
|
||||
/* Updated: 2025/09/10 15:18:58 by tchampio ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -25,6 +25,7 @@ void destroy_texture(t_cub3d_data *data, t_img_data *data_img)
|
|||
|
||||
void destroy_textures(t_cub3d_data *data)
|
||||
{
|
||||
int i;
|
||||
if (data->no_texture)
|
||||
mlx_destroy_image(data->mlx, data->no_texture->img);
|
||||
free(data->no_texture);
|
||||
|
|
@ -37,6 +38,9 @@ void destroy_textures(t_cub3d_data *data)
|
|||
if (data->we_texture)
|
||||
mlx_destroy_image(data->mlx, data->we_texture->img);
|
||||
free(data->we_texture);
|
||||
i = 0;
|
||||
while (i < 7)
|
||||
destroy_texture(data, data->barricades_texture[i++]);
|
||||
}
|
||||
|
||||
void destroy_sprites(t_cub3d_data *data)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue