From 7b4622715bfda581b10305e1781443f92358b319 Mon Sep 17 00:00:00 2001 From: vsr Date: Fri, 13 Sep 2013 06:35:30 +0000 Subject: [PATCH] Fix memory leaks --- src/SMESH_SWIG/smeshBuilder.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/SMESH_SWIG/smeshBuilder.py b/src/SMESH_SWIG/smeshBuilder.py index 736316f7f..994e3f16e 100644 --- a/src/SMESH_SWIG/smeshBuilder.py +++ b/src/SMESH_SWIG/smeshBuilder.py @@ -1176,7 +1176,7 @@ class Mesh: else: geo_name = "%s_%s to mesh"%(self.geom.GetShapeType(), id(self.geom)%100) geompyD.addToStudy( self.geom, geo_name ) - self.mesh = self.smeshpyD.CreateMesh(self.geom) + self.SetMesh( self.smeshpyD.CreateMesh(self.geom) ) elif isinstance(obj, SMESH._objref_SMESH_Mesh): self.SetMesh(obj) @@ -1199,7 +1199,17 @@ class Mesh: if isinstance( attr, algoCreator ): #print "algoCreator ", attrName setattr( self, attrName, attr.copy( self )) + pass + pass + pass + ## Destructor. Clean-up resources + def __del__(self): + if self.mesh: + self.mesh.UnRegister() + pass + pass + ## Initializes the Mesh object from an instance of SMESH_Mesh interface # @param theMesh a SMESH_Mesh object # @ingroup l2_construct -- 2.39.2