Fix memory leakage for CutAlongPolyline

This commit is contained in:
Jørgen Herje
2024-03-11 14:34:41 +01:00
parent 639f9d0ee3
commit f5dbee792f
3 changed files with 20 additions and 20 deletions

View File

@@ -120,7 +120,7 @@ void RivPolylineIntersectionGeometryGenerator::generateIntersectionGeometry( cvf
//--------------------------------------------------------------------------------------------------
void RivPolylineIntersectionGeometryGenerator::calculateArrays( cvf::UByteArray* visibleCells )
{
if ( m_hexGrid.isNull() || m_polylineSegmentsMeshData.size() != 0 ) return;
if ( m_hexGrid == nullptr || m_polylineSegmentsMeshData.size() != 0 ) return;
// Mesh data per polyline segment
std::vector<PolylineSegmentMeshData> polylineSegmentMeshData = {};

View File

@@ -79,8 +79,8 @@ private:
static std::vector<cvf::Vec3d> initializePolylineUtmFromPolylineUtmXy( const std::vector<cvf::Vec2d>& polylineUtmXy );
private:
cvf::ref<RivIntersectionHexGridInterface> m_hexGrid;
const std::vector<cvf::Vec3d> m_polylineUtm;
RivIntersectionHexGridInterface* m_hexGrid = nullptr;
const std::vector<cvf::Vec3d> m_polylineUtm;
// Output
std::vector<PolylineSegmentMeshData> m_polylineSegmentsMeshData;