1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-26 01:39:05 -05:00

Merge pull request #2277 from srcejon/fix_2083

HeatMap: Fix crash when out of memory
This commit is contained in:
Edouard Griffiths 2024-10-12 09:57:44 +02:00 committed by GitHub
commit 141d0c1e6f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1505,6 +1505,8 @@ void HeatMapGUI::plotPowerVsTimeChart()
void HeatMapGUI::addToPowerSeries(QDateTime dateTime, double average, double pulseAverage, double max, double min, double pathLoss) void HeatMapGUI::addToPowerSeries(QDateTime dateTime, double average, double pulseAverage, double max, double min, double pathLoss)
{ {
if (m_powerAverageSeries) if (m_powerAverageSeries)
{
try
{ {
qint64 msecs = dateTime.toMSecsSinceEpoch(); qint64 msecs = dateTime.toMSecsSinceEpoch();
if (!std::isnan(average)) { if (!std::isnan(average)) {
@ -1523,6 +1525,12 @@ void HeatMapGUI::addToPowerSeries(QDateTime dateTime, double average, double pul
m_powerPathLossSeries->append(msecs, pathLoss); m_powerPathLossSeries->append(msecs, pathLoss);
} }
} }
catch (std::bad_alloc&)
{
QMessageBox::critical(this, "Heat Map", QString("Failed to allocate memory for chart series"));
ui->displayChart->setChecked(false);
}
}
} }
void HeatMapGUI::updateAxis() void HeatMapGUI::updateAxis()