Skip to content

Commit

Permalink
Fix memory leak
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@14173 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed Sep 1, 2010
1 parent 2801abe commit d832757
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/core/pal/feature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -869,7 +869,10 @@ namespace pal
}

if ( total_distance == 0 )
{
delete[] path_distances;
return 0;
}

LinkedList<LabelPosition*> *positions = new LinkedList<LabelPosition*> ( ptrLPosCompare );
double delta = max( f->labelInfo->label_height, total_distance / 10.0 );
Expand Down Expand Up @@ -941,6 +944,7 @@ namespace pal
( *lPos )[i] = positions->pop_front();
}
delete positions;
delete[] path_distances;

return nbp;
}
Expand Down

0 comments on commit d832757

Please sign in to comment.