0021562: EDF SMESH: clipping and delete mesh clipped leads to crash

This commit is contained in:
ouv 2012-04-25 14:19:17 +00:00
parent 0bb2ab4898
commit b6aab8c7f6
2 changed files with 13 additions and 3 deletions

View 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 )
{

View 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);