Skip to content
Permalink
Browse files

[Geometry checker] Fix possible use of deleted geometry

  • Loading branch information
manisandro committed Dec 1, 2016
1 parent 50ba777 commit b3742fed839758c98303304f255bb0c4116145fb
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/plugins/geometry_checker/checks/qgsgeometrygapcheck.cpp
@@ -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() )
{
@@ -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;

0 comments on commit b3742fe

Please sign in to comment.
You can’t perform that action at this time.