Free linechart overlay flags properly on shutdown

This commit is contained in:
Mark Watkins 2014-08-05 21:30:25 +10:00
parent dd9994b884
commit 68b4e7bba4

View File

@ -34,6 +34,14 @@ gLineChart::gLineChart(ChannelID code, QColor col, bool square_plot, bool disabl
} }
gLineChart::~gLineChart() gLineChart::~gLineChart()
{ {
QHash<ChannelID, gLineOverlayBar *>::iterator fit;
for (fit = flags.begin(); fit != flags.end(); ++fit) {
// destroy any overlay bar from previous day
delete fit.value();
}
flags.clear();
} }
bool gLineChart::isEmpty() bool gLineChart::isEmpty()
@ -851,7 +859,7 @@ void gLineChart::paint(QPainter &painter, gGraph &w, const QRegion &region)
legendx -= bw*2; legendx -= bw*2;
} }
} }
if (m_day && (p_profile->appearance->lineCursorMode() || (m_codes[0]==CPAP_FlowRate || mouseover))) { if (m_day && (p_profile->appearance->lineCursorMode() || (m_codes[0]==CPAP_FlowRate))) {
QHash<ChannelID, gLineOverlayBar *>::iterator fit; QHash<ChannelID, gLineOverlayBar *>::iterator fit;
for (fit = flags.begin(); fit != flags.end(); ++fit) { for (fit = flags.begin(); fit != flags.end(); ++fit) {
fit.value()->paint(painter, w, region); fit.value()->paint(painter, w, region);