Skip to content
Permalink
Browse files
use unique_ptr
  • Loading branch information
uclaros authored and nyalldawson committed Oct 4, 2022
1 parent 8212a53 commit 801ed323f7fea57a33cb8ee2fd99d30e72dc3f9a
Showing 1 changed file with 2 additions and 4 deletions.
@@ -8443,7 +8443,7 @@ QString QgisApp::saveAsPointCloudLayer( QgsPointCloudLayer *pclayer )
if ( exp->feedback() && exp->feedback()->isCanceled() )
return;

QgsMapLayer *ml = exp->takeExportedLayer();
std::unique_ptr<QgsMapLayer> ml( exp->takeExportedLayer() );
if ( ! ml->isValid() )
{
if ( ! exp->lastError().isEmpty() )
@@ -8457,9 +8457,7 @@ QString QgisApp::saveAsPointCloudLayer( QgsPointCloudLayer *pclayer )
}

if ( addToCanvas && ml->isValid() )
QgsProject::instance()->addMapLayer( ml );
else
delete ml;
QgsProject::instance()->addMapLayer( ml.release() );
} );
}
return vectorFilename;

0 comments on commit 801ed32

Please sign in to comment.