Skip to content
Permalink
Browse files

Fix some leaks in labeling (many left)

  • Loading branch information
nyalldawson committed Aug 26, 2015
1 parent 02cd767 commit 36675babc2d5d88f94d3a167e49581865305d637
@@ -110,6 +110,7 @@ namespace pal
{
mHoles.at( i )->holeOf = this;
}

}


@@ -119,7 +120,6 @@ namespace pal

qDeleteAll( mHoles );
mHoles.clear();

}

void FeaturePart::extractCoords( const GEOSGeometry* geom )
@@ -166,6 +166,7 @@ namespace pal
xmax = ymax = -DBL_MAX;

// initialize coordinate arrays
deleteCoords();
x = new double[nbPoints];
y = new double[nbPoints];

@@ -175,8 +175,6 @@ namespace pal
probFeat = other.probFeat;
nbOverlap = other.nbOverlap;

memcpy( x, other.x, sizeof( double )*4 );
memcpy( y, other.y, sizeof( double )*4 );
alpha = other.alpha;
w = other.w;
h = other.h;
@@ -235,6 +235,10 @@ namespace pal
delete biggest_part; // safe with NULL part
biggest_part = fpart;
}
else
{
delete fpart;
}
continue; // don't add the feature part now, do it later
// TODO: we should probably add also other parts to act just as obstacles
}
@@ -463,6 +467,7 @@ namespace pal
newFeatureParts->append( newfpart );
newfpart->getBoundingBox( bmin, bmax );
rtree->Insert( bmin, bmax, newfpart );
delete fpart;
}
else
{
@@ -330,6 +330,7 @@ namespace pal

/** Add newly created feature part into r tree and to the list */
void addFeaturePart( FeaturePart* fpart, const QString &labelText = QString() );

};

} // end namespace pal
@@ -386,6 +386,7 @@ namespace pal

if ( isCancelled() )
{
qDeleteAll( *fFeats );
delete fFeats;
delete prob;
delete obstacles;
@@ -464,6 +465,7 @@ namespace pal
{
if ( isCancelled() )
{
qDeleteAll( *fFeats );
delete fFeats;
delete prob;
delete obstacles;
@@ -126,12 +126,8 @@ namespace pal
nbPoints = ps.nbPoints;
x = new double[nbPoints];
y = new double[nbPoints];

for ( i = 0; i < nbPoints; i++ )
{
x[i] = ps.x[i];
y[i] = ps.y[i];
}
memcpy( x, ps.x, sizeof( double )* nbPoints );
memcpy( y, ps.y, sizeof( double )* nbPoints );

if ( ps.cHull )
{
@@ -4227,6 +4227,7 @@ void QgsPalLabeling::drawLabeling( QgsRenderContext& context )
if ( context.renderingStopped() )
{
delete problem;
deleteTemporaryData();
return; // it has been cancelled
}

0 comments on commit 36675ba

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