From: mzn Date: Wed, 21 May 2008 08:46:45 +0000 (+0000) Subject: Fix for bug IPAL19437. X-Git-Tag: V5_1_0a1~48 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=385b46d935289596a6621c5486eea7864c1ff7d6;p=modules%2Fsmesh.git Fix for bug IPAL19437. --- diff --git a/src/SMESH_I/SMESH_Gen_i.cxx b/src/SMESH_I/SMESH_Gen_i.cxx index 4b0f6971d..f05003b01 100644 --- a/src/SMESH_I/SMESH_Gen_i.cxx +++ b/src/SMESH_I/SMESH_Gen_i.cxx @@ -3603,10 +3603,16 @@ void SMESH_Gen_i::Close( SALOMEDS::SComponent_ptr theComponent ) } // delete SMESH_Mesh's - StudyContextStruct* context = myGen.GetStudyContext( studyId ); - map< int, SMESH_Mesh* >::iterator i_mesh = context->mapMesh.begin(); - for ( ; i_mesh != context->mapMesh.end(); ++i_mesh ) - delete i_mesh->second; +// See bug IPAL19437. +// +// StudyContextStruct* context = myGen.GetStudyContext( studyId ); +// map< int, SMESH_Mesh* >::iterator i_mesh = context->mapMesh.begin(); +// for ( ; i_mesh != context->mapMesh.end(); ++i_mesh ) { +// printf( "--------------------------- SMESH_Gen_i::Close, delete aGroup = %p \n", i_mesh->second ); +// delete i_mesh->second; +// } + + // delete SMESHDS_Mesh's // it's too long on big meshes // if ( context->myDocument ) { diff --git a/src/SMESH_I/SMESH_Group_i.cxx b/src/SMESH_I/SMESH_Group_i.cxx index 66113ca18..9f4c705f3 100644 --- a/src/SMESH_I/SMESH_Group_i.cxx +++ b/src/SMESH_I/SMESH_Group_i.cxx @@ -80,9 +80,8 @@ SMESH_GroupOnGeom_i::SMESH_GroupOnGeom_i( PortableServer::POA_ptr thePOA, SMESH_ SMESH_GroupBase_i::~SMESH_GroupBase_i() { MESSAGE("~SMESH_GroupBase_i; this = "<removeGroup(myLocalID); + if ( myMeshServant ) + myMeshServant->removeGroup(myLocalID); } //======================================================================= diff --git a/src/SMESH_I/SMESH_Mesh_i.cxx b/src/SMESH_I/SMESH_Mesh_i.cxx index 7a6256462..a52c3b0c2 100644 --- a/src/SMESH_I/SMESH_Mesh_i.cxx +++ b/src/SMESH_I/SMESH_Mesh_i.cxx @@ -117,15 +117,14 @@ SMESH_Mesh_i::~SMESH_Mesh_i() for ( it = _mapGroups.begin(); it != _mapGroups.end(); it++ ) { SMESH_GroupBase_i* aGroup = dynamic_cast( SMESH_Gen_i::GetServant( it->second ).in() ); if ( aGroup ) { - // this method is colled from destructor of group (PAL6331) //_impl->RemoveGroup( aGroup->GetLocalID() ); - - removeGroup( aGroup->GetLocalID() ); + aGroup->Destroy(); } } _mapGroups.clear(); + delete _impl; } //=============================================================================