]> SALOME platform Git repositories - tools/medcoupling.git/commitdiff
Salome HOME
Constructors throwing should not call instance (ie non-static) methods.
authorabn <adrien.bruneton@cea.fr>
Mon, 21 Sep 2020 08:32:09 +0000 (10:32 +0200)
committerabn <adrien.bruneton@cea.fr>
Thu, 24 Sep 2020 13:51:44 +0000 (15:51 +0200)
Thx Clang :-)

src/MEDCoupling/MEDCouplingGaussLocalization.cxx

index ebf9cc4a0a44a53167824d4b241fbcafe108f184..e4e5ea0517550c4af6386014c29a3ddb95b14954 100644 (file)
@@ -34,29 +34,18 @@ using namespace MEDCoupling;
 
 MEDCouplingGaussLocalization::MEDCouplingGaussLocalization(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
                                                            const std::vector<double>& gsCoo, const std::vector<double>& w)
-try:_type(type),_ref_coord(refCoo),_gauss_coord(gsCoo),_weight(w)
+:_type(type),_ref_coord(refCoo),_gauss_coord(gsCoo),_weight(w)
 {
+  // Will potentially throw (and then release memory for above objects _ref_coord etc ...)
   checkConsistencyLight();
 }
-catch(INTERP_KERNEL::Exception& e)
-{
-    _type=INTERP_KERNEL::NORM_ERROR;
-    _ref_coord.clear();
-    _gauss_coord.clear();
-    _weight.clear();
-    throw e;
-}
 
 MEDCouplingGaussLocalization::MEDCouplingGaussLocalization(INTERP_KERNEL::NormalizedCellType typ)
-try:_type(typ)
+:_type(typ)
 {
+  // Will potentially throw
   INTERP_KERNEL::CellModel::GetCellModel(_type);
 }
-catch(INTERP_KERNEL::Exception& e)
-{
-    _type=INTERP_KERNEL::NORM_ERROR;
-    throw e;
-}
 
 void MEDCouplingGaussLocalization::setType(INTERP_KERNEL::NormalizedCellType typ)
 {