Skip to content

Commit

Permalink
fix leak
Browse files Browse the repository at this point in the history
  • Loading branch information
3nids committed Feb 21, 2022
1 parent 4f87cee commit 3cccf4f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/core/geometry/qgsgeometryeditutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ Qgis::GeometryOperationResult QgsGeometryEditUtils::addPart( QgsAbstractGeometry
|| QgsWkbTypes::flatType( part->wkbType() ) == QgsWkbTypes::Triangle
|| QgsWkbTypes::flatType( part->wkbType() ) == QgsWkbTypes::CurvePolygon )
{
QgsCurvePolygon *curvePolygon = qgsgeometry_cast<QgsCurvePolygon *>( part.release() );
QgsCurvePolygon *curvePolygon = qgsgeometry_cast<QgsCurvePolygon *>( part.get() );
if ( curvePolygon )
{
if ( QgsWkbTypes::flatType( geom->wkbType() ) == QgsWkbTypes::MultiPolygon && curvePolygon->hasCurvedSegments() )
Expand All @@ -151,6 +151,7 @@ Qgis::GeometryOperationResult QgsGeometryEditUtils::addPart( QgsAbstractGeometry
delete curvePolygon;
curvePolygon = polygon;
}
part.release();
added = geomCollection->addGeometry( curvePolygon );
}
else
Expand Down Expand Up @@ -210,7 +211,7 @@ Qgis::GeometryOperationResult QgsGeometryEditUtils::addPart( QgsAbstractGeometry
}
else
{
QgsCurve *curve = qgsgeometry_cast<QgsCurve *>( part.release() );
QgsCurve *curve = qgsgeometry_cast<QgsCurve *>( part.get() );
if ( curve )
{
if ( QgsWkbTypes::flatType( geom->wkbType() ) == QgsWkbTypes::MultiLineString && curve->hasCurvedSegments() )
Expand All @@ -220,6 +221,7 @@ Qgis::GeometryOperationResult QgsGeometryEditUtils::addPart( QgsAbstractGeometry
delete curve;
curve = line;
}
part.release();
added = geomCollection->addGeometry( curve );
}
else
Expand Down

0 comments on commit 3cccf4f

Please sign in to comment.