kopia lustrzana https://github.com/f4exb/sdrangel
HeatMap: Catch memory allocation failures when adding data to the chart and disable it. For #2083
rodzic
f24600b909
commit
1654642fdb
|
@ -1505,6 +1505,8 @@ void HeatMapGUI::plotPowerVsTimeChart()
|
|||
void HeatMapGUI::addToPowerSeries(QDateTime dateTime, double average, double pulseAverage, double max, double min, double pathLoss)
|
||||
{
|
||||
if (m_powerAverageSeries)
|
||||
{
|
||||
try
|
||||
{
|
||||
qint64 msecs = dateTime.toMSecsSinceEpoch();
|
||||
if (!std::isnan(average)) {
|
||||
|
@ -1523,6 +1525,12 @@ void HeatMapGUI::addToPowerSeries(QDateTime dateTime, double average, double pul
|
|||
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()
|
||||
|
|
Ładowanie…
Reference in New Issue