Skip to content
Permalink
Browse files

RAII for pal

  • Loading branch information
m-kuhn committed Mar 10, 2019
1 parent 7ceb97a commit 9de4b88e765332ce6891ade1711927f85cf7e887
Showing with 2 additions and 4 deletions.
  1. +2 −4 src/core/pal/layer.cpp
@@ -118,7 +118,7 @@ bool Layer::registerFeature( QgsLabelFeature *lf )
std::unique_ptr<FeaturePart> biggest_part;

// break the (possibly multi-part) geometry into simple geometries
QLinkedList<const GEOSGeometry *> *simpleGeometries = Util::unmulti( lf->geometry() );
std::unique_ptr<QLinkedList<const GEOSGeometry *>> simpleGeometries( Util::unmulti( lf->geometry() ) );
if ( !simpleGeometries ) // unmulti() failed?
{
throw InternalException::UnknownGeometry();
@@ -203,12 +203,11 @@ bool Layer::registerFeature( QgsLabelFeature *lf )
addFeaturePart( fpart.release(), lf->labelText() );
addedFeature = true;
}
delete simpleGeometries;

if ( !featureGeomIsObstacleGeom )
{
//do the same for the obstacle geometry
simpleGeometries = Util::unmulti( lf->obstacleGeometry() );
simpleGeometries.reset( Util::unmulti( lf->obstacleGeometry() ) );
if ( !simpleGeometries ) // unmulti() failed?
{
throw InternalException::UnknownGeometry();
@@ -249,7 +248,6 @@ bool Layer::registerFeature( QgsLabelFeature *lf )
// feature part is ready!
addObstaclePart( fpart.release() );
}
delete simpleGeometries;
}

locker.unlock();

0 comments on commit 9de4b88

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