Skip to content

Commit

Permalink
[Geometry checker] Fix possible use of deleted geometry
Browse files Browse the repository at this point in the history
  • Loading branch information
manisandro committed Dec 1, 2016
1 parent 1ce2a10 commit 3bd8a29
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 @@ -87,7 +87,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 )
{
QgsAbstractGeometry* geom = QgsGeometryCheckerUtils::getGeomPart( diffGeom, iPart );
QgsAbstractGeometry* geom = QgsGeometryCheckerUtils::getGeomPart( diffGeom, iPart )->clone();
// Skip the gap between features and boundingbox
if ( geom->boundingBox() == envelope->boundingBox() )
{
Expand Down Expand Up @@ -127,7 +127,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 3bd8a29

Please sign in to comment.