mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-26 00:02:08 -05:00
[Geometry checker] Fix possible use of deleted geometry
This commit is contained in:
parent
1ce2a102bb
commit
3bd8a29ad5
@ -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 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 )
|
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
|
// Skip the gap between features and boundingbox
|
||||||
if ( geom->boundingBox() == envelope->boundingBox() )
|
if ( geom->boundingBox() == envelope->boundingBox() )
|
||||||
{
|
{
|
||||||
@ -127,7 +127,7 @@ void QgsGeometryGapCheck::collectErrors( QList<QgsGeometryCheckError*>& errors,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Add error
|
// 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;
|
delete unionGeom;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user