PVS: V794 The assignment operator should be protected from the case of 'this == ...'
This commit is contained in:
@@ -65,6 +65,9 @@ Toolpath::~Toolpath()
|
||||
|
||||
Toolpath &Toolpath::operator=(const Toolpath& otherPath)
|
||||
{
|
||||
if (this == &otherPath)
|
||||
return *this;
|
||||
|
||||
clear();
|
||||
vpcCommands.resize(otherPath.vpcCommands.size());
|
||||
int i = 0;
|
||||
|
||||
@@ -34,6 +34,8 @@ namespace geoff_geometry {
|
||||
|
||||
const SpanVertex& SpanVertex::operator= (const SpanVertex& spv ){
|
||||
///
|
||||
if (this == &spv)
|
||||
return *this;
|
||||
|
||||
memcpy(x, spv.x, SPANSTORAGE * sizeof(double));
|
||||
memcpy(y, spv.y, SPANSTORAGE * sizeof(double));
|
||||
@@ -430,6 +432,9 @@ namespace geoff_geometry {
|
||||
}
|
||||
|
||||
const Kurve& Kurve::operator=( const Kurve &k) {
|
||||
if (this == &k)
|
||||
return *this;
|
||||
|
||||
memcpy(e, k.e, 16 * sizeof(double));
|
||||
m_unit = k.m_unit;
|
||||
m_mirrored = k.m_mirrored;
|
||||
|
||||
@@ -81,6 +81,9 @@ Trajectory::~Trajectory()
|
||||
|
||||
Trajectory &Trajectory::operator=(const Trajectory& Trac)
|
||||
{
|
||||
if (this == &Trac)
|
||||
return *this;
|
||||
|
||||
for(std::vector<Waypoint*>::iterator it = vpcWaypoints.begin();it!=vpcWaypoints.end();++it)
|
||||
delete ( *it );
|
||||
vpcWaypoints.clear();
|
||||
|
||||
Reference in New Issue
Block a user