From: eap Date: Fri, 14 Dec 2012 13:37:18 +0000 (+0000) Subject: 21948: EDF SMESH : Memory is not freed when deleting a mesh X-Git-Tag: pluginMGCleaner~252 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=37eb4517855a767e4e8e12c3cc9ff310d2c531bc;p=modules%2Fsmesh.git 21948: EDF SMESH : Memory is not freed when deleting a mesh Fix leaks of myPreHighlightActor and myHighlightActor --- diff --git a/src/OBJECT/SMESH_Actor.cxx b/src/OBJECT/SMESH_Actor.cxx index 1463f03fe..94d90d1b2 100644 --- a/src/OBJECT/SMESH_Actor.cxx +++ b/src/OBJECT/SMESH_Actor.cxx @@ -129,9 +129,11 @@ SMESH_ActorDef::SMESH_ActorDef() myIsEntityModeCache = false; myHighlightActor = SMESH_SVTKActor::New(); + myHighlightActor->Delete(); // vtkSmartPointer! myHighlightActor->Initialize(); myPreHighlightActor = SMESH_SVTKActor::New(); + myPreHighlightActor->Delete(); myPreHighlightActor->Initialize(); myIsShrinkable = false; @@ -539,12 +541,9 @@ SMESH_ActorDef::~SMESH_ActorDef() { if(MYDEBUG) MESSAGE("~SMESH_ActorDef - "<Delete(); myScalarBarActor->Delete(); myLookupTable->Delete(); @@ -553,47 +552,53 @@ SMESH_ActorDef::~SMESH_ActorDef() myBackSurfaceProp->Delete(); myNormalVProp->Delete(); myReversedVProp->Delete(); - myOutLineProp->Delete(); - myEdgeProp->Delete(); + myNodeProp->Delete(); + + myNodeActor->Delete(); + myBaseActor->Delete(); + //myPickableActor->Delete(); myPickableActor == myBaseActor + myHighlightProp->Delete(); + myOutLineProp->Delete(); myPreselectProp->Delete(); - myNodeProp->Delete(); - myNodeExtProp->Delete(); - - my0DProp->Delete(); - my0DActor->Delete(); - myBallActor->Delete(); - - //my0DExtProp->Delete(); - //my0DExtActor->Delete(); - - my1DProp->Delete(); - my1DActor->Delete(); + myBallHighlightProp->Delete(); + myBallPreselectProp->Delete(); - my1DExtProp->Delete(); - my1DExtActor->Delete(); + myHighlitableActor->Delete(); - my2DActor->Delete(); my2DExtProp->Delete(); + my3DExtProp->Delete(); + my2DActor->Delete(); my2DExtActor->Delete(); my3DActor->Delete(); - my3DExtProp->Delete(); my3DExtActor->Delete(); + // myControlActor->Delete(); myControlActor == my2DActor - myNodeActor->Delete(); - myBaseActor->Delete(); - + myNodeExtProp->Delete(); myNodeExtActor->Delete(); - myHighlitableActor->Delete(); + + my1DProp->Delete(); + my1DActor->Delete(); + my1DExtProp->Delete(); + my1DExtActor->Delete(); - myImplicitBoolean->Delete(); + my0DProp->Delete(); + my0DActor->Delete(); + myBallProp->Delete(); + myBallActor->Delete(); + //my0DExtProp->Delete(); + //my0DExtActor->Delete(); + + myImplicitBoolean->Delete(); - myTimeStamp->Delete(); - myBallHighlightProp->Delete(); - myBallPreselectProp->Delete(); - +#ifndef DISABLE_PLOT2DVIEWER + if(my2dHistogram) { + SMESH::ProcessIn2DViewers(this,SMESH::RemoveFrom2dViewer); + delete my2dHistogram; + } +#endif } void SMESH_ActorDef::Delete() @@ -1681,12 +1686,12 @@ void SMESH_ActorDef::UpdateHighlight(){ { if(myIsHighlighted) { myHighlitableActor->SetProperty(myHighlightProp); - myBallActor->SetProperty(myBallHighlightProp); + myBallActor->SetProperty(myBallHighlightProp); }else if(myIsPreselected){ myHighlitableActor->SetProperty(myPreselectProp); - myBallActor->SetProperty(myBallPreselectProp); + myBallActor->SetProperty(myBallPreselectProp); } else if(anIsVisible){ - myBallActor->SetProperty(myBallProp); + myBallActor->SetProperty(myBallProp); (myRepresentation == eSurface) ? myHighlitableActor->SetProperty(myOutLineProp) : myHighlitableActor->SetProperty(myEdgeProp); }