Skip to content
Permalink
Browse files

[Geometry checker] Fix possible use of deleted geometry

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

0 comments on commit 3bd8a29

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