Fix memory leak

git-svn-id: http://svn.osgeo.org/qgis/trunk@14173 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
mhugent 2010-09-01 08:59:32 +00:00
parent 94f418a180
commit b33d801285

View File

@ -869,7 +869,10 @@ namespace pal
} }
if ( total_distance == 0 ) if ( total_distance == 0 )
{
delete[] path_distances;
return 0; return 0;
}
LinkedList<LabelPosition*> *positions = new LinkedList<LabelPosition*> ( ptrLPosCompare ); LinkedList<LabelPosition*> *positions = new LinkedList<LabelPosition*> ( ptrLPosCompare );
double delta = max( f->labelInfo->label_height, total_distance / 10.0 ); double delta = max( f->labelInfo->label_height, total_distance / 10.0 );
@ -941,6 +944,7 @@ namespace pal
( *lPos )[i] = positions->pop_front(); ( *lPos )[i] = positions->pop_front();
} }
delete positions; delete positions;
delete[] path_distances;
return nbp; return nbp;
} }