delete NULL is a no-op

This commit is contained in:
Sean Rhea
2009-11-07 14:27:01 -05:00
parent 6150d4435f
commit 7394df755f

View File

@@ -413,19 +413,15 @@ CpintPlot::clear_CP_Curves()
{
// unattach any existing shading curves and reset the list
if (allCurves.size()) {
foreach (QwtPlotCurve *curve, allCurves) {
if (curve)
delete curve;
}
foreach (QwtPlotCurve *curve, allCurves)
delete curve;
allCurves.clear();
}
// now delete any labels
if (allZoneLabels.size()) {
foreach (QwtPlotMarker *label, allZoneLabels) {
if (label)
delete label;
}
foreach (QwtPlotMarker *label, allZoneLabels)
delete label;
allZoneLabels.clear();
}
}