diff options
| author | Charles <sircharlesaze@gmail.com> | 2020-01-11 12:37:34 +0100 |
|---|---|---|
| committer | Charles <sircharlesaze@gmail.com> | 2020-01-11 12:37:34 +0100 |
| commit | cff05e83256a67b8cb23b16b1e1e6f761ff52f4c (patch) | |
| tree | 33eb6eae520a085d6774205601f13d07dc99aaf9 /state.c | |
| parent | 0dcba6ff7e68ed13f8e6caadd80b77506b917050 (diff) | |
| download | cub3d-cff05e83256a67b8cb23b16b1e1e6f761ff52f4c.tar.gz cub3d-cff05e83256a67b8cb23b16b1e1e6f761ff52f4c.tar.bz2 cub3d-cff05e83256a67b8cb23b16b1e1e6f761ff52f4c.zip | |
fixing a few segfault, map border checking
Diffstat (limited to 'state.c')
| -rw-r--r-- | state.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -6,7 +6,7 @@ /* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2019/11/19 16:39:57 by cacharle #+# #+# */ -/* Updated: 2020/01/11 10:24:53 by cacharle ### ########.fr */ +/* Updated: 2020/01/11 12:32:13 by cacharle ### ########.fr */ /* */ /* ************************************************************************** */ @@ -106,7 +106,8 @@ void *state_destroy(t_state *state) while (++i < TEXTURES_NUM) { free(state->textures_path[i]); - mlx_destroy_image(state->mlx_ptr, state->textures[i].id); + if (state->mlx_ptr != NULL&& state->textures[i].id != NULL) + mlx_destroy_image(state->mlx_ptr, state->textures[i].id); } if (state->mlx_ptr && state->window_ptr) mlx_destroy_window(state->mlx_ptr, state->window_ptr); |
