all repos — mgba @ 57c8ac1dd9832ff51335341ad9eeb29ff477f062

mGBA Game Boy Advance Emulator

Core: Improve memory handling when deleting a cheat device
Vicki Pfau vi@endrift.com
Fri, 18 Dec 2020 02:54:59 -0800
commit

57c8ac1dd9832ff51335341ad9eeb29ff477f062

parent

0cf138775b2169241c54447a75e6032c0d4684bb

3 files changed, 1 insertions(+), 2 deletions(-)

jump to
M src/core/cheats.csrc/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.csrc/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.csrc/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);