Skip to content

Commit 6f7ad82

Browse files
committed
Fix crash when clearing all nodes using node tool
1 parent 66c7d68 commit 6f7ad82

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/app/nodetool/qgsnodetool.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,8 @@ static QgsGeometry geometryToMultiPoint( const QgsGeometry &geom )
126126
{
127127
QgsMultiPoint *multiPoint = new QgsMultiPoint();
128128
QgsGeometry outputGeom( multiPoint );
129-
const QgsAbstractGeometry *g = geom.constGet();
130-
for ( int i = 0; i < g->partCount(); ++i )
131-
for ( int j = 0; j < g->ringCount( i ); ++j )
132-
for ( int k = 0; k < g->vertexCount( i, j ); ++k )
133-
multiPoint->addGeometry( new QgsPoint( g->vertexAt( QgsVertexId( i, j, k ) ) ) );
129+
for ( auto pointIt = geom.vertices_begin(); pointIt != geom.vertices_end(); ++pointIt )
130+
multiPoint->addGeometry( ( *pointIt ).clone() );
134131
return outputGeom;
135132
}
136133

0 commit comments

Comments
 (0)