]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
0021562: EDF SMESH: clipping and delete mesh clipped leads to crash
authorouv <ouv@opencascade.com>
Wed, 25 Apr 2012 14:19:17 +0000 (14:19 +0000)
committerouv <ouv@opencascade.com>
Wed, 25 Apr 2012 14:19:17 +0000 (14:19 +0000)
src/OBJECT/SMESH_Actor.cxx
src/OBJECT/SMESH_ActorDef.h

index aff514d7dbda46642d729bac095a37a3b70a197b..683e6cb6fb77114d8fe6d598137eb5415ab606b0 100644 (file)
@@ -492,9 +492,6 @@ SMESH_ActorDef::~SMESH_ActorDef()
   }
 #endif
 
-  // caught by SMESHGUI::ProcessEvents() static method
-  this->InvokeEvent( SMESH::DeleteActorEvent, NULL );
-
   myScalarBarActor->Delete();
   myLookupTable->Delete();
 
@@ -538,6 +535,17 @@ SMESH_ActorDef::~SMESH_ActorDef()
   myTimeStamp->Delete();
 }
 
+void SMESH_ActorDef::Delete()
+{
+  // This is just to guarantee that the DeleteActorEvent (which was previously invoked
+  // from the actor's destructor) will be thrown before removing the actor's observers,
+  // that is done inside the Superclass::Delete() method but before the destructor itself
+  // (see the issue 0021562: EDF SMESH: clipping and delete mesh clipped leads to crash).
+  // The event is caught by SMESHGUI::ProcessEvents() static method.
+  this->InvokeEvent( SMESH::DeleteActorEvent, NULL );
+
+  Superclass::Delete();
+}
 
 void SMESH_ActorDef::SetPointsLabeled( bool theIsPointsLabeled )
 {    
index d6e2739215fb97ce6d0745db29605d75712ccb1c..1c257ff9984b06443214db299da3f1831bdf1e73 100644 (file)
@@ -84,6 +84,8 @@ class SMESH_ActorDef : public SMESH_Actor
  public:
   vtkTypeMacro(SMESH_ActorDef,SMESH_Actor);
   
+  virtual void Delete();
+
   virtual void ReleaseGraphicsResources(vtkWindow *renWin);
   virtual int RenderOpaqueGeometry(vtkViewport *viewport);
   virtual int RenderTranslucentGeometry(vtkViewport *viewport);