diff --git a/mainwindow.cpp b/mainwindow.cpp index 36e8c71..9f56429 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -9251,6 +9251,23 @@ void MainWindow::processBufferedActivity() { foreach(auto freq, m_messageBuffer.keys()) { auto buffer = m_messageBuffer[freq]; + // check to make sure we empty old buffers by getting the latest timestamp + // and checking to see if it's older than one minute. + auto dt = QDateTime::currentDateTimeUtc().addDays(-1); + if(buffer.cmd.utcTimestamp.isValid()){ + dt = qMax(dt, buffer.cmd.utcTimestamp); + } + if(!buffer.compound.isEmpty()){ + dt = qMax(dt, buffer.compound.last().utcTimestamp); + } + if(!buffer.msgs.isEmpty()){ + dt = qMax(dt, buffer.msgs.last().utcTimestamp); + } + if(dt.secsTo(QDateTime::currentDateTimeUtc()) > 60){ + m_messageBuffer.remove(freq); + continue; + } + if (buffer.msgs.isEmpty()) { continue; } diff --git a/mainwindow.h b/mainwindow.h index 8d440a4..966cd40 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -711,8 +711,8 @@ private: }; struct MessageBuffer { - QQueue compound; CommandDetail cmd; + QQueue compound; QList msgs; };