From 437af22ab44142cb1d60d873e6ff707554fe1a3c Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Sat, 22 Jun 2019 13:03:53 -0700 Subject: [PATCH] Core: Fix crash when exiting game with cheats loaded --- CHANGES | 1 + src/core/cheats.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 4f9ec60d3..a8b304ad2 100644 --- a/CHANGES +++ b/CHANGES @@ -7,6 +7,7 @@ Other fixes: - Qt: Fix FPS target maxing out at 59.727 (fixes mgba.io/i/1421) - Core: Fix crashes if core directories aren't set - Qt: Cap audio buffer size to 8192 (fixes mgba.io/i/1433) + - Core: Fix crash when exiting game with cheats loaded Misc: - Qt: Make mute menu option also toggle fast-forward mute (fixes mgba.io/i/1424) diff --git a/src/core/cheats.c b/src/core/cheats.c index 0abcbd537..4881087a9 100644 --- a/src/core/cheats.c +++ b/src/core/cheats.c @@ -82,11 +82,11 @@ void mCheatSetInit(struct mCheatSet* set, const char* name) { } void mCheatSetDeinit(struct mCheatSet* set) { - mCheatListDeinit(&set->list); size_t i; for (i = 0; i < StringListSize(&set->lines); ++i) { free(*StringListGetPointer(&set->lines, i)); } + mCheatListDeinit(&set->list); if (set->name) { free(set->name); }