mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-22 08:04:49 -05:00
Merge pull request #2277 from srcejon/fix_2083
HeatMap: Fix crash when out of memory
This commit is contained in:
commit
141d0c1e6f
@ -1506,21 +1506,29 @@ void HeatMapGUI::addToPowerSeries(QDateTime dateTime, double average, double pul
|
|||||||
{
|
{
|
||||||
if (m_powerAverageSeries)
|
if (m_powerAverageSeries)
|
||||||
{
|
{
|
||||||
qint64 msecs = dateTime.toMSecsSinceEpoch();
|
try
|
||||||
if (!std::isnan(average)) {
|
{
|
||||||
m_powerAverageSeries->append(msecs, average);
|
qint64 msecs = dateTime.toMSecsSinceEpoch();
|
||||||
|
if (!std::isnan(average)) {
|
||||||
|
m_powerAverageSeries->append(msecs, average);
|
||||||
|
}
|
||||||
|
if (!std::isnan(pulseAverage)) {
|
||||||
|
m_powerPulseAverageSeries->append(msecs, pulseAverage);
|
||||||
|
}
|
||||||
|
if (!std::isnan(max)) {
|
||||||
|
m_powerMaxPeakSeries->append(msecs, max);
|
||||||
|
}
|
||||||
|
if (!std::isnan(min)) {
|
||||||
|
m_powerMinPeakSeries->append(msecs, min);
|
||||||
|
}
|
||||||
|
if (!std::isnan(pathLoss)) {
|
||||||
|
m_powerPathLossSeries->append(msecs, pathLoss);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (!std::isnan(pulseAverage)) {
|
catch (std::bad_alloc&)
|
||||||
m_powerPulseAverageSeries->append(msecs, pulseAverage);
|
{
|
||||||
}
|
QMessageBox::critical(this, "Heat Map", QString("Failed to allocate memory for chart series"));
|
||||||
if (!std::isnan(max)) {
|
ui->displayChart->setChecked(false);
|
||||||
m_powerMaxPeakSeries->append(msecs, max);
|
|
||||||
}
|
|
||||||
if (!std::isnan(min)) {
|
|
||||||
m_powerMinPeakSeries->append(msecs, min);
|
|
||||||
}
|
|
||||||
if (!std::isnan(pathLoss)) {
|
|
||||||
m_powerPathLossSeries->append(msecs, pathLoss);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user