From 6919ace4bc68fa0c2887ea230cec5b1102b025d5 Mon Sep 17 00:00:00 2001 From: AZero13 Date: Wed, 12 Nov 2025 10:40:56 -0500 Subject: [PATCH] Removal of cheats should be based on cheat_count, not gb_cheats This is because we call free based on cheat_count, not if cheats is not null. --- Core/cheats.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/cheats.c b/Core/cheats.c index 4eaf31d3..309493d3 100644 --- a/Core/cheats.c +++ b/Core/cheats.c @@ -143,7 +143,7 @@ void GB_remove_cheat(GB_gameboy_t *gb, const GB_cheat_t *cheat) void GB_remove_all_cheats(GB_gameboy_t *gb) { - while (gb->cheats) { + while (gb->cheat_count) { GB_remove_cheat(gb, gb->cheats[0]); } }