From c8c0cf395afbded6981227eda198d5e45a462f0f Mon Sep 17 00:00:00 2001 From: Sean Rhea Date: Fri, 6 Nov 2009 09:13:59 -0500 Subject: [PATCH] ~qwt_plot_item calls detach --- src/CpintPlot.cpp | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/CpintPlot.cpp b/src/CpintPlot.cpp index f4c23f908..5d87b8a9d 100644 --- a/src/CpintPlot.cpp +++ b/src/CpintPlot.cpp @@ -418,10 +418,8 @@ CpintPlot::clear_CP_Curves() // unattach any existing shading curves and reset the list if (allCurves.size()) { foreach (QwtPlotCurve *curve, allCurves) { - if (curve) { - curve->detach(); + if (curve) delete curve; - } } allCurves.clear(); } @@ -429,10 +427,8 @@ CpintPlot::clear_CP_Curves() // now delete any labels if (allZoneLabels.size()) { foreach (QwtPlotMarker *label, allZoneLabels) { - if (label) { - label->detach(); + if (label) delete label; - } } allZoneLabels.clear(); } @@ -587,11 +583,9 @@ CpintPlot::calculate(RideItem *rideItem) bestDates.clear(); cpiDataInBests.clear(); if (CPCurve) { - CPCurve->detach(); delete CPCurve; CPCurve = NULL; } - fflush(stderr); bool aborted = false; QList to_update; @@ -697,9 +691,10 @@ CpintPlot::calculate(RideItem *rideItem) } if (!needToScanRides) { - if (thisCurve) + if (thisCurve) { delete thisCurve; - thisCurve = NULL; + thisCurve = NULL; + } QVector bests; QVector bestDates; if ((read_cpi_file(dir, file, bests, bestDates, NULL) == 0) && bests.size()) {