Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
use unique_ptr
  • Loading branch information
uclaros authored and nyalldawson committed Oct 4, 2022
1 parent 8212a53 commit 801ed32
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/app/qgisapp.cpp
Expand Up @@ -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() )
Expand All @@ -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;
Expand Down

0 comments on commit 801ed32

Please sign in to comment.