1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-12-23 01:55:48 -05:00

Remove radiosondes from map on close and fix memory leak

This commit is contained in:
Jon Beniston 2023-02-16 14:32:50 +00:00
parent fe300d6d44
commit 116748bb8d

View File

@ -200,7 +200,8 @@ RadiosondeGUI::RadiosondeGUI(PluginAPI* pluginAPI, FeatureUISet *featureUISet, F
RadiosondeGUI::~RadiosondeGUI()
{
qDeleteAll(m_radiosondes);
// Remove from map and free memory
on_deleteAll_clicked();
delete ui;
}
@ -392,8 +393,11 @@ void RadiosondeGUI::sendToMap(const QString &name, const QString &label,
swgMapItem->setAltitude(altitude);
swgMapItem->setAltitudeReference(0); // ABSOLUTE
if (positionDateTime.isValid()) {
if (positionDateTime.isValid())
{
swgMapItem->setPositionDateTime(new QString(positionDateTime.toString(Qt::ISODateWithMs)));
swgMapItem->setOrientationDateTime(new QString(positionDateTime.toString(Qt::ISODateWithMs)));
swgMapItem->setAvailableUntil(new QString(positionDateTime.addSecs(1*60*60).toString(Qt::ISODateWithMs)));
}
swgMapItem->setImageRotation(heading);
@ -877,8 +881,8 @@ void RadiosondeGUI::on_deleteAll_clicked()
0.0f);
// Remove from table
ui->radiosondes->removeRow(row);
// Remove from hash
m_radiosondes.remove(serial);
// Remove from hash and free memory
delete m_radiosondes.take(serial);
}
}