mirror of https://github.com/mgba-emu/mgba.git
GBA Cheats: Add GBACheatDeviceClear
This commit is contained in:
parent
a53c3e0628
commit
e436f2a727
|
@ -110,13 +110,18 @@ void GBACheatDeviceCreate(struct GBACheatDevice* device) {
|
|||
}
|
||||
|
||||
void GBACheatDeviceDestroy(struct GBACheatDevice* device) {
|
||||
GBACheatDeviceClear(device);
|
||||
GBACheatSetsDeinit(&device->cheats);
|
||||
}
|
||||
|
||||
void GBACheatDeviceClear(struct GBACheatDevice* device) {
|
||||
size_t i;
|
||||
for (i = 0; i < GBACheatSetsSize(&device->cheats); ++i) {
|
||||
struct GBACheatSet* set = *GBACheatSetsGetPointer(&device->cheats, i);
|
||||
GBACheatSetDeinit(set);
|
||||
free(set);
|
||||
}
|
||||
GBACheatSetsDeinit(&device->cheats);
|
||||
GBACheatSetsClear(&device->cheats);
|
||||
}
|
||||
|
||||
void GBACheatSetInit(struct GBACheatSet* set, const char* name) {
|
||||
|
|
|
@ -192,6 +192,7 @@ struct VFile;
|
|||
|
||||
void GBACheatDeviceCreate(struct GBACheatDevice*);
|
||||
void GBACheatDeviceDestroy(struct GBACheatDevice*);
|
||||
void GBACheatDeviceClear(struct GBACheatDevice*);
|
||||
|
||||
void GBACheatSetInit(struct GBACheatSet*, const char* name);
|
||||
void GBACheatSetDeinit(struct GBACheatSet*);
|
||||
|
|
Loading…
Reference in New Issue