From: Anthony Geay Date: Thu, 19 Aug 2021 06:17:07 +0000 (+0200) Subject: Fix error introduced in 465e5be442f0 X-Git-Tag: V9_8_0a1~14 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=3d7a8eccb8fe0e2851cdd346caf29aa62c1c9773;p=modules%2Fsmesh.git Fix error introduced in 465e5be442f0 --- diff --git a/src/SMESH_I/SMESH_PreMeshInfo.cxx b/src/SMESH_I/SMESH_PreMeshInfo.cxx index c7a22bf1b..cb9cdb5d4 100644 --- a/src/SMESH_I/SMESH_PreMeshInfo.cxx +++ b/src/SMESH_I/SMESH_PreMeshInfo.cxx @@ -53,6 +53,8 @@ #include "SMESH_TryCatch.hxx" +#include + #include CORBA_SERVER_HEADER(SALOME_Session) using namespace std; @@ -262,8 +264,8 @@ namespace if ( !data.empty() ) { - hdf_size datasetSize[] = { data.size() }; - HDFarray* anArray = new HDFarray(0, HDF_INT32, 1, datasetSize); + hdf_size *datasetSize = new hdf_size[1]; datasetSize[0] = data.size(); + std::unique_ptr anArray( new HDFarray(0, HDF_INT32, 1, datasetSize) ); anArray->CreateOnDisk(); datasetSize[0] = 1; HDFdataset* dataset = new HDFdataset( name.c_str(), hdfGroup, HDF_ARRAY, datasetSize, 1 ); @@ -272,7 +274,6 @@ namespace dataset->WriteOnDisk( & data[0] ); dataset->CloseOnDisk(); anArray->CloseOnDisk(); - delete anArray; } } }