Skip to content

Commit

Permalink
Fix QgsGeometryEditUtils::addPart deleting added geometry
Browse files Browse the repository at this point in the history
  • Loading branch information
manisandro committed Sep 21, 2015
1 parent 7573afc commit 5f78d1c
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/core/geometry/qgsgeometryeditutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ int QgsGeometryEditUtils::addPart( QgsAbstractGeometryV2* geom, QgsAbstractGeome

int i;
int n = geomCollection->numGeometries();
for ( i = 0; i < parts->numGeometries() && geomCollection->addGeometry( parts->geometryN( i ) ); i++ )
for ( i = 0; i < parts->numGeometries() && geomCollection->addGeometry( parts->geometryN( i )->clone() ); i++ )
;

added = i == parts->numGeometries();
Expand All @@ -145,11 +145,6 @@ int QgsGeometryEditUtils::addPart( QgsAbstractGeometryV2* geom, QgsAbstractGeome
delete part; return 2;
}

while ( parts->numGeometries() > 0 )
{
parts->removeGeometry( 0 );
}

delete part;
}
else
Expand Down

0 comments on commit 5f78d1c

Please sign in to comment.