From 2940c131bc277f719c28ca1b2930c85207ebb8dd Mon Sep 17 00:00:00 2001 From: dismine Date: Sat, 13 Sep 2014 23:42:58 +0300 Subject: [PATCH] Coverity warnings. --HG-- branch : develop --- src/app/tools/vdatatool.h | 2 -- src/app/tools/vtooluniondetails.cpp | 13 +++++++++---- src/libs/vpropertyexplorer/vproperty.cpp | 3 +++ src/libs/vpropertyexplorer/vproperty_p.h | 2 ++ 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/app/tools/vdatatool.h b/src/app/tools/vdatatool.h index b06c1dbca..887a74fd2 100644 --- a/src/app/tools/vdatatool.h +++ b/src/app/tools/vdatatool.h @@ -74,8 +74,6 @@ inline VContainer VDataTool::getData() const */ inline void VDataTool::setData(const VContainer *value) { - data.ClearVariables(); - data.ClearGObjects(); data = *value; } diff --git a/src/app/tools/vtooluniondetails.cpp b/src/app/tools/vtooluniondetails.cpp index 48fdbb6a5..7eb134cc3 100644 --- a/src/app/tools/vtooluniondetails.cpp +++ b/src/app/tools/vtooluniondetails.cpp @@ -184,6 +184,9 @@ void VToolUnionDetails::AddToNewDetail(QObject *tool, VPattern *doc, VContainer spl1->setMode(Draw::Modeling); id = data->AddGObject(spl1); VNodeSpline::Create(doc, data, id, idObject, Document::FullParse, Source::FromGui, idTool, tool); + + delete p4; + delete p1; } } break; @@ -231,8 +234,10 @@ void VToolUnionDetails::AddToNewDetail(QObject *tool, VPattern *doc, VContainer path->append(VSplinePoint(*p1, splinePath->at(i-1).KAsm1(), spl.GetAngle1()+180, splinePath->at(i-1).KAsm2(), spl.GetAngle1())); } - path->append(VSplinePoint(*p4, splinePath->at(i).KAsm1(), spl.GetAngle2(), - splinePath->at(i).KAsm2(), spl.GetAngle2()+180)); + path->append(VSplinePoint(*p4, splinePath->at(i).KAsm1(), spl.GetAngle2(), + splinePath->at(i).KAsm2(), spl.GetAngle2()+180)); + delete p4; + delete p1; } while (k>=0) { @@ -391,8 +396,8 @@ void VToolUnionDetails::UpdatePoints(const quint32 &idDetail, VContainer *data, path->append(VSplinePoint(*p1, splinePath->at(i-1).KAsm1(), spl.GetAngle1()+180, splinePath->at(i-1).KAsm2(), spl.GetAngle1())); } - path->append(VSplinePoint(*p4, splinePath->at(i).KAsm1(), spl.GetAngle2(), - splinePath->at(i).KAsm2(), spl.GetAngle2()+180)); + path->append(VSplinePoint(*p4, splinePath->at(i).KAsm1(), spl.GetAngle2(), + splinePath->at(i).KAsm2(), spl.GetAngle2()+180)); } while (k>=0) diff --git a/src/libs/vpropertyexplorer/vproperty.cpp b/src/libs/vpropertyexplorer/vproperty.cpp index 2b185a256..836cd0415 100644 --- a/src/libs/vpropertyexplorer/vproperty.cpp +++ b/src/libs/vpropertyexplorer/vproperty.cpp @@ -417,3 +417,6 @@ void VProperty::ValueChildChanged(const QVariant &value, int typeForParent) UserChangeEvent::~UserChangeEvent() {} + +VPE::VPropertyPrivate::~VPropertyPrivate() +{} diff --git a/src/libs/vpropertyexplorer/vproperty_p.h b/src/libs/vpropertyexplorer/vproperty_p.h index b91fc4fc6..db04d39e0 100644 --- a/src/libs/vpropertyexplorer/vproperty_p.h +++ b/src/libs/vpropertyexplorer/vproperty_p.h @@ -80,6 +80,8 @@ public: UpdateParent(false), UpdateChildren(false), Parent(nullptr), editor(nullptr), type(Property::Simple), Children(QList()) {} + + virtual ~VPropertyPrivate(); private: Q_DISABLE_COPY(VPropertyPrivate) };