mirror of https://github.com/mgba-emu/mgba.git
Core: Improve memory handling when deleting a cheat device
This commit is contained in:
parent
0cf138775b
commit
57c8ac1dd9
|
@ -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) {
|
||||
|
|
|
@ -143,7 +143,6 @@ static void _GBCoreDeinit(struct mCore* core) {
|
|||
if (gbcore->cheatDevice) {
|
||||
mCheatDeviceDestroy(gbcore->cheatDevice);
|
||||
}
|
||||
free(gbcore->cheatDevice);
|
||||
mCoreConfigFreeOpts(&core->opts);
|
||||
free(core);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue