Skip to content

Commit

Permalink
Fix interpolation tool crashes qgis #12855
Browse files Browse the repository at this point in the history
  • Loading branch information
elpaso authored and m-kuhn committed Jun 19, 2015
1 parent 1d073da commit 94873eb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/analysis/interpolation/DualEdgeTriangulation.cc
Expand Up @@ -77,7 +77,9 @@ void DualEdgeTriangulation::addLine( Line3D* line, bool breakline )
for ( i = 0; i < line->getSize(); i++ )
{
line->goToNext();
actpoint = mDecorator->addPoint( line->getPoint() );
// Use copy ctor since line can be deleted as well as its
// associated Node and Point3D
actpoint = mDecorator->addPoint( new Point3D( *line->getPoint() ) );
if ( actpoint != -100 )
{
i++;
Expand All @@ -94,7 +96,7 @@ void DualEdgeTriangulation::addLine( Line3D* line, bool breakline )
for ( ; i < line->getSize(); i++ )
{
line->goToNext();
currentpoint = mDecorator->addPoint( line->getPoint() );
currentpoint = mDecorator->addPoint( new Point3D( *line->getPoint() ) );
if ( currentpoint != -100 && actpoint != -100 && currentpoint != actpoint )//-100 is the return value if the point could not be not inserted
{
insertForcedSegment( actpoint, currentpoint, breakline );
Expand Down

0 comments on commit 94873eb

Please sign in to comment.