Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[Geometry checker] Fix possible use of deleted geometry
  • Loading branch information
manisandro committed Dec 1, 2016
1 parent 50ba777 commit b3742fe
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/plugins/geometry_checker/checks/qgsgeometrygapcheck.cpp
Expand Up @@ -79,7 +79,7 @@ void QgsGeometryGapCheck::collectErrors( QList<QgsGeometryCheckError*>& errors,
// For each gap polygon which does not lie on the boundary, get neighboring polygons and add error
for ( int iPart = 0, nParts = diffGeom->partCount(); iPart < nParts; ++iPart )
{
QgsAbstractGeometryV2* geom = QgsGeomUtils::getGeomPart( diffGeom, iPart );
QgsAbstractGeometryV2* geom = QgsGeomUtils::getGeomPart( diffGeom, iPart )->clone();
// Skip the gap between features and boundingbox
if ( geom->boundingBox() == envelope->boundingBox() )
{
Expand Down Expand Up @@ -118,7 +118,7 @@ void QgsGeometryGapCheck::collectErrors( QList<QgsGeometryCheckError*>& errors,
}

// Add error
errors.append( new QgsGeometryGapCheckError( this, geom->clone(), neighboringIds, geom->area(), gapAreaBBox ) );
errors.append( new QgsGeometryGapCheckError( this, geom, neighboringIds, geom->area(), gapAreaBBox ) );
}

delete unionGeom;
Expand Down

0 comments on commit b3742fe

Please sign in to comment.