1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-21 15:25:17 +03:00

Fixed many memory leaks

This commit is contained in:
Damjan Adamic 2014-04-14 20:25:17 +02:00
parent b7cc3a5ef2
commit df954ae483
13 changed files with 76 additions and 10 deletions

View file

@ -5,6 +5,7 @@
#include "firmwares/th9x/th9xinterface.h"
#include "firmwares/gruvin9x/gruvin9xinterface.h"
#include "firmwares/opentx/opentxinterface.h"
#include "firmwares/opentx/opentxeeprom.h"
#include "firmwares/ersky9x/ersky9xinterface.h"
#include "appdata.h"
#include "helpers.h"
@ -1202,6 +1203,15 @@ void RegisterEepromInterfaces()
eepromInterfaces.push_back(new Er9xInterface());
}
void UnregisterEepromInterfaces()
{
foreach(EEPROMInterface * intf, eepromInterfaces) {
//std::cout << "UnregisterEepromInterfaces(): deleting " << std::hex << reinterpret_cast<uint64_t>(intf) << std::dec << std::endl;
delete intf;
}
OpenTxEepromCleanup();
}
QList<FirmwareInfo *> firmwares;
FirmwareVariant default_firmware_variant;
FirmwareVariant current_firmware_variant;
@ -1214,6 +1224,12 @@ void RegisterFirmwares()
RegisterEepromInterfaces();
}
void UnregisterFirmwares() {
UnregisterEepromInterfaces();
UnregisterOpen9xFirmwares();
}
bool LoadEeprom(RadioData &radioData, const uint8_t *eeprom, const int size)
{
foreach(EEPROMInterface *eepromInterface, eepromInterfaces) {