From: eap Date: Tue, 22 Jul 2014 14:57:36 +0000 (+0400) Subject: Fix crash at study closing. Enable canceling Prism 3D computation X-Git-Tag: V7_5_0a1~44 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=f3ce9fcd4028efd124456c5e55c4c4c7983cad9f;p=modules%2Fsmesh.git Fix crash at study closing. Enable canceling Prism 3D computation --- diff --git a/src/SMESHDS/SMESHDS_TSubMeshHolder.hxx b/src/SMESHDS/SMESHDS_TSubMeshHolder.hxx index b6fa226da..52c9eb2c4 100644 --- a/src/SMESHDS/SMESHDS_TSubMeshHolder.hxx +++ b/src/SMESHDS/SMESHDS_TSubMeshHolder.hxx @@ -74,12 +74,20 @@ public: void DeleteAll() { for ( size_t i = 0; i < myVec.size(); ++i ) - delete myVec[i]; + if ( SUBMESH* sm = myVec[i] ) + { + myVec[i] = 0; // avoid access via Get(i) + delete sm; + } myVec.clear(); typename std::map< int, SUBMESH* >::iterator i2sm = myMap.begin(); for ( ; i2sm != myMap.end(); ++i2sm ) - delete i2sm->second; + if ( SUBMESH* sm = i2sm->second ) + { + i2sm->second = 0; // avoid access via Get(i) + delete sm; + } myMap.clear(); } int GetMinID() const diff --git a/src/StdMeshers/StdMeshers_Prism_3D.cxx b/src/StdMeshers/StdMeshers_Prism_3D.cxx index 99fdbe90f..afac9bebe 100644 --- a/src/StdMeshers/StdMeshers_Prism_3D.cxx +++ b/src/StdMeshers/StdMeshers_Prism_3D.cxx @@ -1203,6 +1203,9 @@ bool StdMeshers_Prism_3D::compute(const Prism_3D::TPrismTopo& thePrism) // create a node node = meshDS->AddNode( coords.X(), coords.Y(), coords.Z() ); meshDS->SetNodeInVolume( node, volumeID ); + + if ( _computeCanceled ) + return false; } } // loop on bottom nodes }