]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
21948: EDF SMESH : Memory is not freed when deleting a mesh
authoreap <eap@opencascade.com>
Fri, 14 Dec 2012 13:40:14 +0000 (13:40 +0000)
committereap <eap@opencascade.com>
Fri, 14 Dec 2012 13:40:14 +0000 (13:40 +0000)
  Delete fields in order of their declaration in the header - for easier check

src/OBJECT/SMESH_CellLabelActor.cxx
src/OBJECT/SMESH_CellLabelActor.h
src/OBJECT/SMESH_DeviceActor.cxx

index 3e117de16858568a164989c9d6734bc76faba832..81f2107f0964a136eb0e75e273bea664869f9a5d 100644 (file)
@@ -91,7 +91,7 @@ SMESH_CellLabelActor::SMESH_CellLabelActor() {
   callBackCommand->SetCallback(SMESH_CellLabelActor::ProcessEvents);
 
   myTransformFilter->AddObserver("VTKViewer_TransformFilter::TransformationFinished",
-                                callBackCommand);
+                                 callBackCommand);
   callBackCommand->Delete();
 }
 
@@ -103,23 +103,22 @@ SMESH_CellLabelActor::~SMESH_CellLabelActor() {
   //Deleting of cells numbering pipeline
   //---------------------------------------
   myCellsNumDataSet->Delete();
+  myCellsLabels->Delete();
+  // commented: porting to vtk 5.0
+  //  myClsMaskPoints->UnRegisterAllOutputs();
+  myClsMaskPoints->Delete();
+  // commented: porting to vtk 5.0
+  //  myCellCenters->UnRegisterAllOutputs();
+  myCellCenters->Delete();
 
   myClsLabeledDataMapper->RemoveAllInputs();
   myClsLabeledDataMapper->Delete();
-  
   // commented: porting to vtk 5.0
   //  myClsSelectVisiblePoints->UnRegisterAllOutputs();
   myClsSelectVisiblePoints->Delete();
   
-  // commented: porting to vtk 5.0
-  //  myClsMaskPoints->UnRegisterAllOutputs();
-  myClsMaskPoints->Delete();
   
-  // commented: porting to vtk 5.0
-  //  myCellCenters->UnRegisterAllOutputs();
-  myCellCenters->Delete();
   
-  myCellsLabels->Delete();
 }
 
 
@@ -176,9 +175,9 @@ void SMESH_CellLabelActor::UpdateLabels() {
 
 
 void SMESH_CellLabelActor::ProcessEvents(vtkObject* vtkNotUsed(theObject),
-                                        unsigned long theEvent,
-                                        void* theClientData,
-                                        void* vtkNotUsed(theCallData)) {
+                                         unsigned long theEvent,
+                                         void* theClientData,
+                                         void* vtkNotUsed(theCallData)) {
   SMESH_CellLabelActor* self = reinterpret_cast<SMESH_CellLabelActor*>(theClientData);
   if(self)
     self->UpdateLabels();
index 988a0dcaf8cb2994ee4544a4e227d3aa6719f9dd..a754d0b08ffbe5c9e3dfed82edaadd79ff2056c2 100644 (file)
@@ -42,9 +42,9 @@ public:
   static SMESH_CellLabelActor* New();
 
   static void ProcessEvents(vtkObject* theObject,
-                           unsigned long theEvent,
-                           void* theClientData,
-                           void* theCallData);
+                            unsigned long theEvent,
+                            void* theClientData,
+                            void* theCallData);
 
 
   vtkTypeMacro(SMESH_CellLabelActor, SMESH_DeviceActor);
index d53765d79baf12703c580dad0c702028a1d3c08c..c82bbf30524a34ebea0025dc4c3737ebc80775b0 100644 (file)
@@ -138,33 +138,29 @@ SMESH_DeviceActor
 {
   if(MYDEBUG) MESSAGE("~SMESH_DeviceActor - "<<this);
 
-  myProperty->Delete();
-
   myMapper->Delete();
 
-  myShrinkFilter->Delete();
+  myProperty->Delete();
 
-  myExtractUnstructuredGrid->Delete();
+  myExtractGeometry->Delete();
 
   myMergeFilter->Delete();
+  myExtractUnstructuredGrid->Delete();
 
-  myGeomFilter->Delete();
+  // Orientation of faces
+  myFaceOrientationFilter->Delete();
+  myFaceOrientationDataMapper->RemoveAllInputs();
+  myFaceOrientationDataMapper->Delete();
+  myFaceOrientation->Delete();
 
-  myExtractGeometry->Delete();
+  myGeomFilter->Delete();
 
   myTransformFilter->Delete();
 
-  for(int i = 0, iEnd = myPassFilter.size(); i < iEnd; i++){
+  for(int i = 0, iEnd = myPassFilter.size(); i < iEnd; i++)
     myPassFilter[i]->Delete();
-  }
-
-  // Orientation of faces
-  myFaceOrientationFilter->Delete();
-
-  myFaceOrientationDataMapper->RemoveAllInputs();
-  myFaceOrientationDataMapper->Delete();
 
-  myFaceOrientation->Delete();
+  myShrinkFilter->Delete();
 }