From 6fb137bbd1ad4678f19669472435022c8e2504f5 Mon Sep 17 00:00:00 2001 From: Nyall Dawson Date: Tue, 17 Dec 2024 11:40:35 +1000 Subject: [PATCH] Fix leak in point cloud exporter --- src/core/pointcloud/qgspointcloudlayerexporter.cpp | 2 +- src/core/pointcloud/qgspointcloudlayerexporter.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/pointcloud/qgspointcloudlayerexporter.cpp b/src/core/pointcloud/qgspointcloudlayerexporter.cpp index e5e4787792d6..c042aa5d1b11 100644 --- a/src/core/pointcloud/qgspointcloudlayerexporter.cpp +++ b/src/core/pointcloud/qgspointcloudlayerexporter.cpp @@ -54,7 +54,7 @@ QString QgsPointCloudLayerExporter::getOgrDriverName( ExportFormat format ) QgsPointCloudLayerExporter::QgsPointCloudLayerExporter( QgsPointCloudLayer *layer ) : mLayerAttributeCollection( layer->attributes() ) - , mIndex( layer->dataProvider()->index()->clone().release() ) + , mIndex( layer->dataProvider()->index()->clone() ) , mSourceCrs( QgsCoordinateReferenceSystem( layer->crs() ) ) , mTargetCrs( QgsCoordinateReferenceSystem( layer->crs() ) ) { diff --git a/src/core/pointcloud/qgspointcloudlayerexporter.h b/src/core/pointcloud/qgspointcloudlayerexporter.h index 45ed03e42357..fbca3aa606c8 100644 --- a/src/core/pointcloud/qgspointcloudlayerexporter.h +++ b/src/core/pointcloud/qgspointcloudlayerexporter.h @@ -256,7 +256,7 @@ class CORE_EXPORT QgsPointCloudLayerExporter SIP_NODEFAULTCTORS const QgsPointCloudAttributeCollection mLayerAttributeCollection; - QgsPointCloudIndex *mIndex = nullptr; + std::unique_ptr< QgsPointCloudIndex > mIndex; QString mName = QObject::tr( "Exported" ); ExportFormat mFormat = ExportFormat::Memory; QString mFilename;