1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2025-09-04 06:07:49 -04: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() RadiosondeGUI::~RadiosondeGUI()
{ {
qDeleteAll(m_radiosondes); // Remove from map and free memory
on_deleteAll_clicked();
delete ui; delete ui;
} }
@ -392,8 +393,11 @@ void RadiosondeGUI::sendToMap(const QString &name, const QString &label,
swgMapItem->setAltitude(altitude); swgMapItem->setAltitude(altitude);
swgMapItem->setAltitudeReference(0); // ABSOLUTE swgMapItem->setAltitudeReference(0); // ABSOLUTE
if (positionDateTime.isValid()) { if (positionDateTime.isValid())
{
swgMapItem->setPositionDateTime(new QString(positionDateTime.toString(Qt::ISODateWithMs))); 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); swgMapItem->setImageRotation(heading);
@ -877,8 +881,8 @@ void RadiosondeGUI::on_deleteAll_clicked()
0.0f); 0.0f);
// Remove from table // Remove from table
ui->radiosondes->removeRow(row); ui->radiosondes->removeRow(row);
// Remove from hash // Remove from hash and free memory
m_radiosondes.remove(serial); delete m_radiosondes.take(serial);
} }
} }