Skip to content

Commit

Permalink
Fix crash on geos closestPoint
Browse files Browse the repository at this point in the history
  • Loading branch information
uclaros authored and nyalldawson committed Dec 25, 2020
1 parent 05e2a59 commit 0dc0ca5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/geometry/qgsgeos.cpp
Expand Up @@ -2251,11 +2251,11 @@ QgsGeometry QgsGeos::closestPoint( const QgsGeometry &other, QString *errorMsg )
geos::coord_sequence_unique_ptr nearestCoord; geos::coord_sequence_unique_ptr nearestCoord;
if ( mGeosPrepared ) // use faster version with prepared geometry if ( mGeosPrepared ) // use faster version with prepared geometry
{ {
nearestCoord.reset( GEOSNearestPoints_r( geosinit()->ctxt, mGeos.get(), otherGeom.get() ) ); nearestCoord.reset( GEOSPreparedNearestPoints_r( geosinit()->ctxt, mGeosPrepared.get(), otherGeom.get() ) );
} }
else else
{ {
nearestCoord.reset( GEOSPreparedNearestPoints_r( geosinit()->ctxt, mGeosPrepared.get(), otherGeom.get() ) ); nearestCoord.reset( GEOSNearestPoints_r( geosinit()->ctxt, mGeos.get(), otherGeom.get() ) );
} }
#else #else
geos::coord_sequence_unique_ptr nearestCoord( GEOSNearestPoints_r( geosinit()->ctxt, mGeos.get(), otherGeom.get() ) ); geos::coord_sequence_unique_ptr nearestCoord( GEOSNearestPoints_r( geosinit()->ctxt, mGeos.get(), otherGeom.get() ) );
Expand Down

0 comments on commit 0dc0ca5

Please sign in to comment.