From 3feb7ac7016d6cbdbe1b757ae3c299db8263bdfa Mon Sep 17 00:00:00 2001 From: Viktor Uzlov Date: Wed, 31 Mar 2021 12:29:04 +0300 Subject: [PATCH] bos #24085 fix TSplitMethod method for Windows (to avoid crash) --- src/SMESH/SMESH_MeshEditor.cxx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/SMESH/SMESH_MeshEditor.cxx b/src/SMESH/SMESH_MeshEditor.cxx index 8a872c724..de20777e9 100644 --- a/src/SMESH/SMESH_MeshEditor.cxx +++ b/src/SMESH/SMESH_MeshEditor.cxx @@ -1808,6 +1808,17 @@ namespace TSplitMethod( int nbTet=0, const int* conn=0, bool addNode=false) : _nbSplits(nbTet), _nbCorners(4), _connectivity(conn), _baryNode(addNode), _ownConn(false) {} ~TSplitMethod() { if ( _ownConn ) delete [] _connectivity; _connectivity = 0; } + TSplitMethod(const TSplitMethod &splitMethod) + : _nbSplits(splitMethod._nbSplits), + _nbCorners(splitMethod._nbCorners), + _baryNode(splitMethod._baryNode), + _ownConn(splitMethod._ownConn), + _faceBaryNode(splitMethod._faceBaryNode) + { + _connectivity = splitMethod._connectivity; + const_cast(splitMethod)._connectivity = nullptr; + const_cast(splitMethod)._ownConn = false; + } bool hasFacet( const TTriangleFacet& facet ) const { if ( _nbCorners == 4 ) @@ -2265,7 +2276,7 @@ void SMESH_MeshEditor::SplitVolumes (const TFacetOfElem & theElems, TSplitMethod splitMethod = ( facetToSplit < 0 ? getTetraSplitMethod( volTool, theMethodFlags ) : getPrismSplitMethod( volTool, theMethodFlags, facetToSplit )); - if ( splitMethod._nbSplits < 1 ) continue; + if ( splitMethod._nbSplits < 1 ) continue; // find submesh to add new tetras to if ( !subMesh || !subMesh->Contains( elem )) -- 2.39.2