mirror of
https://github.com/qgis/QGIS.git
synced 2025-03-09 00:35:20 -05:00
Better memory management
This commit is contained in:
parent
432317f50c
commit
594e52f444
@ -380,7 +380,7 @@ void Layer::chopFeaturesAtRepeatDistance()
|
||||
QLinkedList<FeaturePart *> newFeatureParts;
|
||||
while ( !mFeatureParts.isEmpty() )
|
||||
{
|
||||
FeaturePart *fpart = mFeatureParts.takeFirst();
|
||||
std::unique_ptr< FeaturePart > fpart( mFeatureParts.takeFirst() );
|
||||
const GEOSGeometry *geom = fpart->geos();
|
||||
double chopInterval = fpart->repeatDistance();
|
||||
if ( chopInterval != 0. && GEOSGeomTypeId_r( geosctxt, geom ) == GEOS_LINESTRING )
|
||||
@ -389,7 +389,7 @@ void Layer::chopFeaturesAtRepeatDistance()
|
||||
|
||||
double bmin[2], bmax[2];
|
||||
fpart->getBoundingBox( bmin, bmax );
|
||||
mFeatureIndex->Remove( bmin, bmax, fpart );
|
||||
mFeatureIndex->Remove( bmin, bmax, fpart.get() );
|
||||
|
||||
const GEOSCoordSequence *cs = GEOSGeom_getCoordSeq_r( geosctxt, geom );
|
||||
|
||||
@ -462,11 +462,10 @@ void Layer::chopFeaturesAtRepeatDistance()
|
||||
newFeatureParts.append( newfpart );
|
||||
newfpart->getBoundingBox( bmin, bmax );
|
||||
mFeatureIndex->Insert( bmin, bmax, newfpart );
|
||||
delete fpart;
|
||||
}
|
||||
else
|
||||
{
|
||||
newFeatureParts.append( fpart );
|
||||
newFeatureParts.append( fpart.release() );
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user