Skip to content
Permalink
Browse files
Fix another memory leak
git-svn-id: http://svn.osgeo.org/qgis/trunk@14178 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed Sep 2, 2010
1 parent ed9a7e1 commit c593facc90c0be1d0f8917e2fd5c369c2c37405b
Showing with 6 additions and 7 deletions.
  1. +6 −7 src/core/pal/feature.cpp
@@ -654,7 +654,6 @@ namespace pal

if ( index <= 1 && distance < 0 ) // We've gone off the start, fail out
{
std::cerr << "err1" << std::endl;
return NULL;
}

@@ -666,7 +665,6 @@ namespace pal
}
if ( index >= path_positions->nbPoints )
{
std::cerr << "err2" << std::endl;
return NULL;
}

@@ -688,7 +686,6 @@ namespace pal
if ( segment_length == 0 )
{
// Not allowed to place across on 0 length segments or discontinuities
std::cerr << "err3" << std::endl;
return NULL;
}

@@ -714,7 +711,7 @@ namespace pal
if ( segment_length == 0 )
{
// Not allowed to place across on 0 length segments or discontinuities
std::cerr << "err4" << std::endl;
delete slp;
return NULL;
}

@@ -743,7 +740,7 @@ namespace pal
index++;
if ( index >= path_positions->nbPoints ) // Bail out if we run off the end of the shape
{
//std::cerr << "err5" << std::endl;
delete slp;
return NULL;
}
new_x = path_positions->x[index];
@@ -777,7 +774,7 @@ namespace pal
while ( angle_delta < -M_PI ) angle_delta += 2 * M_PI;
if ( f->labelInfo->max_char_angle_delta > 0 && fabs( angle_delta ) > f->labelInfo->max_char_angle_delta*( M_PI / 180 ) )
{
std::cerr << "err6" << std::endl;
delete slp;
return NULL;
}

@@ -826,12 +823,14 @@ namespace pal
if ( !orientation_forced )
{
orientation = -orientation;
delete slp;
slp = NULL;
slp = curvedPlacementAtOffset( path_positions, path_distances, orientation, initial_index, initial_distance );
}
else
{
// Otherwise we have failed to find a placement
//std::cerr << "err7" << std::endl;
delete slp;
return NULL;
}
}

0 comments on commit c593fac

Please sign in to comment.