Skip to content
Permalink
Browse files

RAII

  • Loading branch information
m-kuhn committed Mar 9, 2019
1 parent 785dd7f commit e41766e5db2ada16f981a7b2d5b0f819b5d5652d
Showing with 2 additions and 13 deletions.
  1. +1 −10 src/core/qgsvectorlayerlabelprovider.cpp
  2. +1 −3 src/core/qgsvectorlayerlabelprovider.h
@@ -47,13 +47,7 @@ QgsVectorLayerLabelProvider::QgsVectorLayerLabelProvider( QgsVectorLayer *layer,

if ( withFeatureLoop )
{
mSource = new QgsVectorLayerFeatureSource( layer );
mOwnsSource = true;
}
else
{
mSource = nullptr;
mOwnsSource = false;
mSource = qgis::make_unique<QgsVectorLayerFeatureSource>( layer );
}

init();
@@ -94,9 +88,6 @@ void QgsVectorLayerLabelProvider::init()
QgsVectorLayerLabelProvider::~QgsVectorLayerLabelProvider()
{
qDeleteAll( mLabels );

if ( mOwnsSource )
delete mSource;
}


@@ -108,9 +108,7 @@ class CORE_EXPORT QgsVectorLayerLabelProvider : public QgsAbstractLabelProvider
//! Layer's CRS
QgsCoordinateReferenceSystem mCrs;
//! Layer's feature source
QgsAbstractFeatureSource *mSource = nullptr;
//! Whether layer's feature source is owned
bool mOwnsSource;
std::unique_ptr<QgsAbstractFeatureSource> mSource;

//! List of generated
QList<QgsLabelFeature *> mLabels;

0 comments on commit e41766e

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