From: eap Date: Wed, 7 Nov 2007 09:31:56 +0000 (+0000) Subject: PAL16774 (Crash after display of many groups) X-Git-Tag: V3_2_9rc1~35 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=214ce58a7aa408073bee8b7053ddc734ee046583;p=modules%2Fsmesh.git PAL16774 (Crash after display of many groups) + virtual void studyClosed( SUIT_Study* ); and catch during visualization --- diff --git a/src/SMESHGUI/SMESHGUI.cxx b/src/SMESHGUI/SMESHGUI.cxx index 860b12117..0fa2fa1f2 100644 --- a/src/SMESHGUI/SMESHGUI.cxx +++ b/src/SMESHGUI/SMESHGUI.cxx @@ -146,6 +146,8 @@ #include "SALOMEDSClient_StudyBuilder.hxx" #include "SALOMEDSClient_SComponent.hxx" +#include + using namespace std; //namespace{ @@ -1260,7 +1262,18 @@ bool SMESHGUI::OnGUIEvent( int theCommandID ) case 214: // UPDATE { if(checkLock(aStudy)) break; - SMESH::UpdateView(); + try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif + SMESH::UpdateView(); + } + catch (std::bad_alloc) { // PAL16774 (Crash after display of many groups) + SMESH::OnVisuException(); + } + catch (...) { // PAL16774 (Crash after display of many groups) + SMESH::OnVisuException(); + } SALOME_ListIO l; LightApp_SelectionMgr *aSel = SMESHGUI::selectionMgr(); @@ -1291,12 +1304,16 @@ bool SMESHGUI::OnGUIEvent( int theCommandID ) extractContainers( sel_objects, to_process ); try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif if (vtkwnd) { SALOME_ListIteratorOfListIO It( to_process ); for (; It.More(); It.Next()) { Handle(SALOME_InteractiveObject) IOS = It.Value(); if (IOS->hasEntry()) { - SMESH::UpdateView(anAction, IOS->getEntry()); + if (!SMESH::UpdateView(anAction, IOS->getEntry())) + break; // PAL16774 (Crash after display of many groups) if (anAction == SMESH::eDisplayOnly) anAction = SMESH::eDisplay; } @@ -2936,6 +2953,12 @@ bool SMESHGUI::deactivateModule( SUIT_Study* study ) return SalomeApp_Module::deactivateModule( study ); } +void SMESHGUI::studyClosed( SUIT_Study* s ) +{ + SMESH::RemoveVisuData( s->id() ); + SalomeApp_Module::studyClosed( s ); +} + void SMESHGUI::OnGUIEvent() { const QObject* obj = sender();