mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-01-25 05:40:34 +05:00
Regression: mesh objects are not deleted => memory leaks
This commit is contained in:
parent
db7a4ffa0c
commit
5552aec787
@ -2592,14 +2592,13 @@ const std::vector< SMESH_subMesh * > & SMESH_subMesh::GetAncestors() const
|
|||||||
SMESH_subMesh* me = const_cast< SMESH_subMesh* >( this );
|
SMESH_subMesh* me = const_cast< SMESH_subMesh* >( this );
|
||||||
me->_ancestors.reserve( ancShapes.Extent() );
|
me->_ancestors.reserve( ancShapes.Extent() );
|
||||||
|
|
||||||
TopTools_MapOfShape map;
|
|
||||||
|
|
||||||
// assure that all sub-meshes exist
|
// assure that all sub-meshes exist
|
||||||
TopoDS_Shape mainShape = _father->GetShapeToMesh();
|
TopoDS_Shape mainShape = _father->GetShapeToMesh();
|
||||||
if (!mainShape.IsNull())
|
if ( !mainShape.IsNull() )
|
||||||
{
|
_father->GetSubMesh( mainShape )->DependsOn();
|
||||||
_father->GetSubMesh( _father->GetShapeToMesh() )->DependsOn();
|
|
||||||
}
|
TopTools_MapOfShape map;
|
||||||
|
|
||||||
for ( TopTools_ListIteratorOfListOfShape it( ancShapes ); it.More(); it.Next() )
|
for ( TopTools_ListIteratorOfListOfShape it( ancShapes ); it.More(); it.Next() )
|
||||||
if ( SMESH_subMesh* sm = _father->GetSubMeshContaining( it.Value() ))
|
if ( SMESH_subMesh* sm = _father->GetSubMeshContaining( it.Value() ))
|
||||||
if ( map.Add( it.Value() ))
|
if ( map.Add( it.Value() ))
|
||||||
|
@ -308,10 +308,12 @@ static SALOMEDS::SObject_ptr publish(CORBA::Object_ptr theIOR,
|
|||||||
if ( !sameIOR )
|
if ( !sameIOR )
|
||||||
{
|
{
|
||||||
iorAttr->SetValue( objStr.in() );
|
iorAttr->SetValue( objStr.in() );
|
||||||
// UnRegister() !!! --> No: random problems when meshing in parallel (yacs foreach) in distributed python scripts
|
// UnRegister() !!! --> random problems when meshing in parallel (yacs foreach) in
|
||||||
// SALOME::GenericObj_var genObj = SALOME::GenericObj::_narrow( theIOR );
|
// distributed python scripts, because simultaneously created meshes are
|
||||||
// if ( !genObj->_is_nil() )
|
// published into the same SO; as a result the mesh published first dies
|
||||||
// genObj->UnRegister();
|
SALOME::GenericObj_var genObj = SALOME::GenericObj::_narrow( theIOR );
|
||||||
|
if ( !genObj->_is_nil() )
|
||||||
|
genObj->UnRegister();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -598,7 +600,7 @@ SALOMEDS::SObject_ptr SMESH_Gen_i::PublishMesh (SMESH::SMESH_Mesh_ptr theMesh,
|
|||||||
else
|
else
|
||||||
aTag++;
|
aTag++;
|
||||||
|
|
||||||
aMeshSO = publish ( theMesh, father, aTag, "ICON_SMESH_TREE_MESH_WARN" );
|
aMeshSO = publish( theMesh, father, aTag, "ICON_SMESH_TREE_MESH_WARN" );
|
||||||
if ( aMeshSO->_is_nil() )
|
if ( aMeshSO->_is_nil() )
|
||||||
return aMeshSO._retn();
|
return aMeshSO._retn();
|
||||||
}
|
}
|
||||||
|
@ -82,8 +82,15 @@ def geomesh(l0, r0, h0, d0, d1, my_container, direc):
|
|||||||
#geompy.addToStudyInFather( barre, f1, 'f1' )
|
#geompy.addToStudyInFather( barre, f1, 'f1' )
|
||||||
#geompy.addToStudyInFather( barre, f2, 'f2' )
|
#geompy.addToStudyInFather( barre, f2, 'f2' )
|
||||||
|
|
||||||
|
smesh.SetEnablePublish( False )
|
||||||
|
|
||||||
isTetra = False
|
isTetra = False
|
||||||
barre_1 = smesh.Mesh(barre)
|
barre_1 = smesh.Mesh(barre)
|
||||||
|
# SO = salome.myStudy.FindObjectIOR(salome.myStudy.ConvertObjectToIOR(barre_1.GetMesh()))
|
||||||
|
# if SO:
|
||||||
|
# print ("_______",SO.GetID(),SO.GetName())
|
||||||
|
# else:
|
||||||
|
# print ("_______NO_SO!!!")
|
||||||
if (isTetra):
|
if (isTetra):
|
||||||
NETGEN_1D_2D_3D = barre_1.Tetrahedron(algo=smeshBuilder.NETGEN_1D2D3D)
|
NETGEN_1D_2D_3D = barre_1.Tetrahedron(algo=smeshBuilder.NETGEN_1D2D3D)
|
||||||
NETGEN_3D_Parameters_1 = NETGEN_1D_2D_3D.Parameters()
|
NETGEN_3D_Parameters_1 = NETGEN_1D_2D_3D.Parameters()
|
||||||
@ -139,14 +146,15 @@ def geomesh(l0, r0, h0, d0, d1, my_container, direc):
|
|||||||
def clearMesh(theMesh, theStudy, aName):
|
def clearMesh(theMesh, theStudy, aName):
|
||||||
theMesh.Clear()
|
theMesh.Clear()
|
||||||
aMesh = theMesh.GetMesh()
|
aMesh = theMesh.GetMesh()
|
||||||
aStudyBuilder = theStudy.NewBuilder()
|
aMesh.UnRegister()
|
||||||
SO = theStudy.FindObjectIOR(theStudy.ConvertObjectToIOR(aMesh))
|
# aStudyBuilder = theStudy.NewBuilder()
|
||||||
objects_to_unpublish = [SO]
|
# SO = theStudy.FindObjectIOR(theStudy.ConvertObjectToIOR(aMesh))
|
||||||
refs = theStudy.FindDependances(SO)
|
# objects_to_unpublish = [SO]
|
||||||
objects_to_unpublish += refs
|
# refs = theStudy.FindDependances(SO)
|
||||||
for o in objects_to_unpublish:
|
# objects_to_unpublish += refs
|
||||||
if o is not None:
|
# for o in objects_to_unpublish:
|
||||||
aStudyBuilder.RemoveObjectWithChildren(o)
|
# if o is not None:
|
||||||
|
# aStudyBuilder.RemoveObjectWithChildren(o)
|
||||||
print("clearMesh done:", aName)
|
print("clearMesh done:", aName)
|
||||||
|
|
||||||
def genere(r0, h0, my_container, direc):
|
def genere(r0, h0, my_container, direc):
|
||||||
@ -164,4 +172,3 @@ def genere2(r0h0, my_container, direc):
|
|||||||
d1 = d0/2.
|
d1 = d0/2.
|
||||||
res = geomesh(l0, r0, h0, d0, d1, my_container, direc)
|
res = geomesh(l0, r0, h0, d0, d1, my_container, direc)
|
||||||
return res
|
return res
|
||||||
|
|
@ -127,6 +127,7 @@ bool StdMeshers_Quadrangle_2D::CheckHypothesis
|
|||||||
myTrianglePreference = false;
|
myTrianglePreference = false;
|
||||||
myHelper = (SMESH_MesherHelper*)NULL;
|
myHelper = (SMESH_MesherHelper*)NULL;
|
||||||
myParams = NULL;
|
myParams = NULL;
|
||||||
|
myProxyMesh.reset();
|
||||||
myQuadList.clear();
|
myQuadList.clear();
|
||||||
|
|
||||||
aStatus = SMESH_Hypothesis::HYP_OK;
|
aStatus = SMESH_Hypothesis::HYP_OK;
|
||||||
|
Loading…
Reference in New Issue
Block a user