add guard on free

This commit is contained in:
CrackedPixel 2026-04-17 00:17:47 -05:00
parent 2dca13d390
commit 3d5604bbfa

View File

@ -1879,15 +1879,17 @@ void ClosePlatform(void)
mg_gamepads_free(&platform.minigamepad);
RGFW_window_close(platform.window);
if (platform.surfacePixels != NULL)
{
RL_FREE(platform.surfacePixels);
}
#if defined(GRAPHICS_API_OPENGL_SOFTWARE)
if (platform.surfacePixels != NULL)
{
RL_FREE(platform.surfacePixels);
}
if (platform.surface != NULL)
{
RGFW_surface_free(platform.surface);
}
if (platform.surface != NULL)
{
RGFW_surface_free(platform.surface);
}
#endif
}
// Keycode mapping