We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7f4880b commit 3da4c33Copy full SHA for 3da4c33
src/core/geometry/qgsgeometry.cpp
@@ -1585,16 +1585,16 @@ QgsGeometry QgsGeometry::centroid() const
1585
}
1586
1587
QgsGeos geos( d->geometry );
1588
- QgsPoint centroid;
+ std::unique_ptr<QgsPoint> centroid( new QgsPoint() );
1589
QString error;
1590
- bool ok = geos.centroid( centroid, &error );
+ bool ok = geos.centroid( *centroid.get(), &error );
1591
if ( !ok )
1592
{
1593
QgsGeometry geom;
1594
geom.d->error = error;
1595
return geom;
1596
1597
- return QgsGeometry( centroid.clone() );
+ return QgsGeometry( centroid.release() );
1598
1599
1600
QgsGeometry QgsGeometry::pointOnSurface() const
0 commit comments