diff options
-rw-r--r-- | qt-ui/diveplanner.cpp | 10 | ||||
-rw-r--r-- | qt-ui/diveplanner.h | 3 |
2 files changed, 11 insertions, 2 deletions
diff --git a/qt-ui/diveplanner.cpp b/qt-ui/diveplanner.cpp index a8f45d91f..1aaf5aa7d 100644 --- a/qt-ui/diveplanner.cpp +++ b/qt-ui/diveplanner.cpp @@ -195,6 +195,16 @@ void DivePlannerGraphics::createDecoStops() scene()->addItem(item); lines << item; } + + deleteTemporaryDivePlan(diveplan.dp); +} + +void DivePlannerGraphics::deleteTemporaryDivePlan(divedatapoint* dp) +{ + if (!dp) + return; + deleteTemporaryDivePlan(dp->next); + free(dp); } void DivePlannerGraphics::resizeEvent(QResizeEvent* event) diff --git a/qt-ui/diveplanner.h b/qt-ui/diveplanner.h index f2073515d..09418f1c6 100644 --- a/qt-ui/diveplanner.h +++ b/qt-ui/diveplanner.h @@ -68,7 +68,7 @@ protected: void clearGeneratedDeco(); void createDecoStops(); bool isPointOutOfBoundaries(const QPointF& point); - + void deleteTemporaryDivePlan(struct divedatapoint* dp); private slots: void increaseTime(); void increaseDepth(); @@ -76,7 +76,6 @@ private slots: void cancelClicked(); private: - void moveActiveHandler(const QPointF& pos); QList<QGraphicsLineItem*> lines; QList<DiveHandler *> handles; |