mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-23 00:02:38 -05:00
Fix leak in geos::linePointDifference
This commit is contained in:
parent
bf45674bc2
commit
dc719fbbb7
@ -1021,17 +1021,22 @@ geos::unique_ptr QgsGeos::linePointDifference( GEOSGeometry *GEOSsplitPoint ) co
|
||||
|
||||
// we might have a point or a multipoint, depending on number of
|
||||
// intersections between the geometry and the split geometry
|
||||
std::unique_ptr< QgsAbstractGeometry > splitGeom( fromGeos( GEOSsplitPoint ) );
|
||||
std::unique_ptr< QgsMultiPoint > splitPoints( qgsgeometry_cast<QgsMultiPoint *>( splitGeom->clone() ) );
|
||||
if ( !splitPoints )
|
||||
std::unique_ptr< QgsMultiPoint > splitPoints;
|
||||
{
|
||||
QgsPoint *splitPoint = qgsgeometry_cast<QgsPoint *>( splitGeom->clone() );
|
||||
if ( !splitPoint )
|
||||
std::unique_ptr< QgsAbstractGeometry > splitGeom( fromGeos( GEOSsplitPoint ) );
|
||||
|
||||
if ( qgsgeometry_cast<QgsMultiPoint *>( splitGeom.get() ) )
|
||||
{
|
||||
return nullptr;
|
||||
splitPoints.reset( qgsgeometry_cast<QgsMultiPoint *>( splitGeom.release() ) );
|
||||
}
|
||||
else if ( qgsgeometry_cast<QgsPoint *>( splitGeom.get() ) )
|
||||
{
|
||||
splitPoints = std::make_unique< QgsMultiPoint >();
|
||||
if ( QgsPoint *point = qgsgeometry_cast<QgsPoint *>( splitGeom.get() ) )
|
||||
{
|
||||
splitPoints->addGeometry( qgsgeometry_cast<QgsPoint *>( splitGeom.release() ) );
|
||||
}
|
||||
}
|
||||
splitPoints.reset( new QgsMultiPoint() );
|
||||
splitPoints->addGeometry( splitPoint );
|
||||
}
|
||||
|
||||
QgsMultiCurve lines;
|
||||
|
Loading…
x
Reference in New Issue
Block a user