Skip to content

Commit

Permalink
RAII
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn authored and nyalldawson committed Aug 8, 2019
1 parent b2872f7 commit 05631b1
Showing 1 changed file with 1 addition and 2 deletions.
Expand Up @@ -70,7 +70,7 @@ void QgsGeometryDuplicateCheck::collectErrors( const QMap<QString, QgsFeaturePoo
}
QString errMsg;
QgsGeometry geomB = layerFeatureB.geometry();
QgsAbstractGeometry *diffGeom = geomEngineA->symDifference( geomB.constGet(), &errMsg );
std::unique_ptr<QgsAbstractGeometry> diffGeom( geomEngineA->symDifference( geomB.constGet(), &errMsg ) );
if ( errMsg.isEmpty() && diffGeom && diffGeom->isEmpty() )
{
duplicates[layerFeatureB.layer()->id()].append( layerFeatureB.feature().id() );
Expand All @@ -79,7 +79,6 @@ void QgsGeometryDuplicateCheck::collectErrors( const QMap<QString, QgsFeaturePoo
{
messages.append( tr( "Duplicate check failed for (%1, %2): %3" ).arg( layerFeatureA.id(), layerFeatureB.id(), errMsg ) );
}
delete diffGeom;
}
if ( !duplicates.isEmpty() )
{
Expand Down

0 comments on commit 05631b1

Please sign in to comment.