diff --git a/src/libs/vtools/visualization/line/vistoolpin.cpp b/src/libs/vtools/visualization/line/vistoolpin.cpp index b942795b6..60abb49e5 100644 --- a/src/libs/vtools/visualization/line/vistoolpin.cpp +++ b/src/libs/vtools/visualization/line/vistoolpin.cpp @@ -33,12 +33,13 @@ //--------------------------------------------------------------------------------------------------------------------- VisToolPin::VisToolPin(const VContainer *data, QGraphicsItem *parent) : VisLine(data, parent), - m_point(nullptr) + m_point() { this->mainColor = Qt::red; this->setZValue(2);// Show on top real tool - m_point = new VSimplePoint(NULL_ID, mainColor, *Visualization::data->GetPatternUnit(), &factor); + m_point = QSharedPointer(new VSimplePoint(NULL_ID, mainColor, *Visualization::data->GetPatternUnit(), + &factor)); m_point->SetPointHighlight(true); m_point->setParentItem(this); m_point->SetVisualizationMode(true); diff --git a/src/libs/vtools/visualization/line/vistoolpin.h b/src/libs/vtools/visualization/line/vistoolpin.h index a8075c42a..2e9e6122b 100644 --- a/src/libs/vtools/visualization/line/vistoolpin.h +++ b/src/libs/vtools/visualization/line/vistoolpin.h @@ -45,7 +45,7 @@ public: enum { Type = UserType + static_cast(Vis::ToolPin)}; private: Q_DISABLE_COPY(VisToolPin) - VSimplePoint *m_point; + QSharedPointer m_point; }; #endif // VISTOOLPIN_H