Skip to content

Commit af0b606

Browse files
author
mhugent
committed
Fix another memory leak
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@14178 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent fb351d4 commit af0b606

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

src/core/pal/feature.cpp

+6-7
Original file line numberDiff line numberDiff line change
@@ -654,7 +654,6 @@ namespace pal
654654

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

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

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

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

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

@@ -826,12 +823,14 @@ namespace pal
826823
if ( !orientation_forced )
827824
{
828825
orientation = -orientation;
826+
delete slp;
827+
slp = NULL;
829828
slp = curvedPlacementAtOffset( path_positions, path_distances, orientation, initial_index, initial_distance );
830829
}
831830
else
832831
{
833832
// Otherwise we have failed to find a placement
834-
//std::cerr << "err7" << std::endl;
833+
delete slp;
835834
return NULL;
836835
}
837836
}

0 commit comments

Comments
 (0)