Fix for bug IPAL19437.

This commit is contained in:
mzn 2008-05-21 08:46:45 +00:00
parent 06bdce2fef
commit 385b46d935
3 changed files with 14 additions and 10 deletions

View File

@ -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 ) {

View File

@ -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 = "<<this );
// akl: removeGroup() is called from SMESH_Mesh_i() destructor
// if ( myMeshServant )
// myMeshServant->removeGroup(myLocalID);
if ( myMeshServant )
myMeshServant->removeGroup(myLocalID);
}
//=======================================================================

View File

@ -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_GroupBase_i*>( 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;
}
//=============================================================================