fixing segmentation fault on mlx_destroy_image

This commit is contained in:
Kbz-8
2024-04-24 13:52:34 +02:00
parent ae6a86800e
commit a5f85a8a4c

View File

@@ -6,7 +6,7 @@
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */ /* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2022/10/04 22:10:52 by maldavid #+# #+# */ /* Created: 2022/10/04 22:10:52 by maldavid #+# #+# */
/* Updated: 2024/04/22 17:35:15 by maldavid ### ########.fr */ /* Updated: 2024/04/24 13:52:18 by maldavid ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@@ -108,7 +108,10 @@ namespace mlx::core
else else
texture->destroy(); texture->destroy();
for(auto& gs : _graphics) for(auto& gs : _graphics)
gs->tryEraseTextureFromManager(texture); {
if(gs)
gs->tryEraseTextureFromManager(texture);
}
_textures.erase(it); _textures.erase(it);
} }