diff --git a/src/core/cheats.c b/src/core/cheats.c index acd994393..015144022 100644 --- a/src/core/cheats.c +++ b/src/core/cheats.c @@ -60,6 +60,7 @@ void mCheatDeviceCreate(struct mCheatDevice* device) { void mCheatDeviceDestroy(struct mCheatDevice* device) { mCheatDeviceClear(device); mCheatSetsDeinit(&device->cheats); + free(device); } void mCheatDeviceClear(struct mCheatDevice* device) { diff --git a/src/gb/core.c b/src/gb/core.c index f0dbac0ba..d6b3fb182 100644 --- a/src/gb/core.c +++ b/src/gb/core.c @@ -143,7 +143,6 @@ static void _GBCoreDeinit(struct mCore* core) { if (gbcore->cheatDevice) { mCheatDeviceDestroy(gbcore->cheatDevice); } - free(gbcore->cheatDevice); mCoreConfigFreeOpts(&core->opts); free(core); } diff --git a/src/gba/core.c b/src/gba/core.c index 1df7286ff..2dc34e33a 100644 --- a/src/gba/core.c +++ b/src/gba/core.c @@ -234,7 +234,6 @@ static void _GBACoreDeinit(struct mCore* core) { if (gbacore->cheatDevice) { mCheatDeviceDestroy(gbacore->cheatDevice); } - free(gbacore->cheatDevice); free(gbacore->audioMixer); mCoreConfigFreeOpts(&core->opts); free(core);