Skip to content

Commit

Permalink
Fix #12190 - splitGeometry crashes on linear geometry with a split point
Browse files Browse the repository at this point in the history
  • Loading branch information
wonder-sk committed Feb 12, 2015
1 parent 90bd24a commit 3803979
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/core/qgsgeometry.cpp
Expand Up @@ -4661,7 +4661,8 @@ GEOSGeometry* QgsGeometry::linePointDifference( GEOSGeometry* GEOSsplitPoint )
else
return 0;

QgsGeometry* geosPoint = fromGeosGeom( GEOSsplitPoint );
// GEOSsplitPoint will be deleted in the caller, so make a clone
QgsGeometry* geosPoint = fromGeosGeom( GEOSGeom_clone_r( geosinit.ctxt, GEOSsplitPoint ) );
QgsPoint splitPoint = geosPoint->asPoint();
delete geosPoint;

Expand Down Expand Up @@ -4746,9 +4747,7 @@ int QgsGeometry::splitLinearGeometry( GEOSGeometry *splitLine, QList<QgsGeometry

if ( lineGeoms.size() > 0 )
{
GEOSGeom_destroy_r( geosinit.ctxt, mGeos );
mGeos = lineGeoms[0];
mDirtyWkb = true;
fromGeos( lineGeoms[0] );
}

for ( int i = 1; i < lineGeoms.size(); ++i )
Expand Down

5 comments on commit 3803979

@jef-n
Copy link
Member

@jef-n jef-n commented on 3803979 Feb 12, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're not investigating why QGIS crashes when the snap locator is removed - because that's what I'm also investigating now...

@3nids
Copy link
Member

@3nids 3nids commented on 3803979 Feb 12, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

multi-threaded bug fixing? ;)

@wonder-sk
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I follow :)

@jef-n
Copy link
Member

@jef-n jef-n commented on 3803979 Feb 12, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, I discovered a snapping related problem after I fixed the bug - I just wanted to make sure that you didn't also find it - because for that there is no issue mutex to aquire.

@wonder-sk
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I see now - I haven't seen such problem... Thanks for the fix, I will try to honor the mutex locking scheme from now!

Please sign in to comment.