Core: Improve memory handling when deleting a cheat device
Vicki Pfau vi@endrift.com
Fri, 18 Dec 2020 02:54:59 -0800
3 files changed,
1 insertions(+),
2 deletions(-)
M
src/core/cheats.c
→
src/core/cheats.c
@@ -60,6 +60,7 @@
void mCheatDeviceDestroy(struct mCheatDevice* device) { mCheatDeviceClear(device); mCheatSetsDeinit(&device->cheats); + free(device); } void mCheatDeviceClear(struct mCheatDevice* device) {
M
src/gb/core.c
→
src/gb/core.c
@@ -143,7 +143,6 @@ free(gbcore->debuggerPlatform);
if (gbcore->cheatDevice) { mCheatDeviceDestroy(gbcore->cheatDevice); } - free(gbcore->cheatDevice); mCoreConfigFreeOpts(&core->opts); free(core); }
M
src/gba/core.c
→
src/gba/core.c
@@ -234,7 +234,6 @@ free(gbacore->debuggerPlatform);
if (gbacore->cheatDevice) { mCheatDeviceDestroy(gbacore->cheatDevice); } - free(gbacore->cheatDevice); free(gbacore->audioMixer); mCoreConfigFreeOpts(&core->opts); free(core);