Skip to content
Permalink
Browse files

#8725-R: no check 0-pointers to delete

  • Loading branch information
ahuarte47 authored and m-kuhn committed Jan 15, 2014
1 parent 61041da commit a7ff8ce33fd07fe8185772159090d27a0ee1d71a
@@ -28,11 +28,8 @@ QgsAbstractFeatureIterator::QgsAbstractFeatureIterator( const QgsFeatureRequest&

QgsAbstractFeatureIterator::~QgsAbstractFeatureIterator()
{
if ( mGeometrySimplifier )
{
delete mGeometrySimplifier;
mGeometrySimplifier = NULL;
}
delete mGeometrySimplifier;
mGeometrySimplifier = NULL;
}

bool QgsAbstractFeatureIterator::nextFeature( QgsFeature& f )
@@ -97,11 +94,8 @@ void QgsAbstractFeatureIterator::deref()

bool QgsAbstractFeatureIterator::prepareSimplification( const QgsSimplifyMethod& simplifyMethod )
{
if ( mGeometrySimplifier )
{
delete mGeometrySimplifier;
mGeometrySimplifier = NULL;
}
delete mGeometrySimplifier;
mGeometrySimplifier = NULL;

// setup the local simplification of geometries to fetch
if ( simplifyMethod.methodType() != QgsSimplifyMethod::NoSimplification && simplifyMethod.forceLocalOptimization() && !( mRequest.flags() & QgsFeatureRequest::NoGeometry ) )
@@ -103,11 +103,8 @@ QgsVectorLayerFeatureIterator::QgsVectorLayerFeatureIterator( QgsVectorLayer* la

QgsVectorLayerFeatureIterator::~QgsVectorLayerFeatureIterator()
{
if ( mEditGeometrySimplifier )
{
delete mEditGeometrySimplifier;
mEditGeometrySimplifier = NULL;
}
delete mEditGeometrySimplifier;
mEditGeometrySimplifier = NULL;

close();
}
@@ -466,11 +463,8 @@ void QgsVectorLayerFeatureIterator::addJoinedAttributes( QgsFeature &f )

bool QgsVectorLayerFeatureIterator::prepareSimplification( const QgsSimplifyMethod& simplifyMethod )
{
if ( mEditGeometrySimplifier )
{
delete mEditGeometrySimplifier;
mEditGeometrySimplifier = NULL;
}
delete mEditGeometrySimplifier;
mEditGeometrySimplifier = NULL;

// setup the simplification of edited geometries to fetch
if ( simplifyMethod.methodType() != QgsSimplifyMethod::NoSimplification && !( mRequest.flags() & QgsFeatureRequest::NoGeometry ) )
@@ -89,11 +89,9 @@ QgsOgrFeatureIterator::QgsOgrFeatureIterator( QgsOgrProvider* p, const QgsFeatur

QgsOgrFeatureIterator::~QgsOgrFeatureIterator()
{
if ( mGeometrySimplifier )
{
delete mGeometrySimplifier;
mGeometrySimplifier = NULL;
}
delete mGeometrySimplifier;
mGeometrySimplifier = NULL;

close();
}

@@ -109,11 +107,8 @@ bool QgsOgrFeatureIterator::prepareSimplification( const QgsSimplifyMethod& simp
{
bool providerSimplification = false;

if ( mGeometrySimplifier )
{
delete mGeometrySimplifier;
mGeometrySimplifier = NULL;
}
delete mGeometrySimplifier;
mGeometrySimplifier = NULL;

// setup if required the simplification of OGR-geometries fetched
if ( simplifyMethod.methodType() != QgsSimplifyMethod::NoSimplification && !simplifyMethod.forceLocalOptimization() && !( mRequest.flags() & QgsFeatureRequest::NoGeometry ) )

0 comments on commit a7ff8ce

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