Skip to content

Commit be1e198

Browse files
author
gsherman
committed
Add check for self assignment to the = operator
git-svn-id: http://svn.osgeo.org/qgis/trunk@5100 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 69a6f68 commit be1e198

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/core/qgsgeometryvertexindex.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,10 @@ QgsGeometryVertexIndex::QgsGeometryVertexIndex( QgsGeometryVertexIndex const & r
3030

3131
QgsGeometryVertexIndex & QgsGeometryVertexIndex::operator=( QgsGeometryVertexIndex const & rhs )
3232
{
33-
mIndex = rhs.mIndex;
33+
if(&rhs != this)
34+
{
35+
mIndex = rhs.mIndex;
36+
}
3437
return *this;
3538
}
3639

0 commit comments

Comments
 (0)