From: mpa Date: Fri, 3 Apr 2015 09:31:31 +0000 (+0300) Subject: INT PAL: 0052664: SIGSEGV at attempt to open 'View' menu when not OCC, VTK or Plot2D... X-Git-Tag: V7_6_0a1~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=57554854e0c045e0508bd1b2ab0fbb8cb439d90d;p=modules%2Fgeom.git INT PAL: 0052664: SIGSEGV at attempt to open 'View' menu when not OCC, VTK or Plot2D view is active. --- diff --git a/src/DisplayGUI/DisplayGUI.cxx b/src/DisplayGUI/DisplayGUI.cxx index ed27084bf..edbeca378 100644 --- a/src/DisplayGUI/DisplayGUI.cxx +++ b/src/DisplayGUI/DisplayGUI.cxx @@ -444,8 +444,11 @@ void DisplayGUI::SetDisplayMode( const int mode, SUIT_ViewWindow* viewWindow ) int mgrId = viewWindow->getViewManager()->getGlobalId(); + SALOME_View* window = displayer.GetActiveView(); + if ( !window ) return; + SALOME_ListIO anIOlst; - displayer.GetActiveView()->GetVisible( anIOlst ); + window->GetVisible( anIOlst ); for ( SALOME_ListIteratorOfListIO It( anIOlst ); It.More(); It.Next() ) { Handle( SALOME_InteractiveObject ) io = It.Value(); @@ -479,8 +482,11 @@ void DisplayGUI::SetVectorMode( const bool mode, SUIT_ViewWindow* viewWindow ) int aMgrId = viewWindow->getViewManager()->getGlobalId(); + SALOME_View* window = displayer.GetActiveView(); + if ( !window ) return; + SALOME_ListIO anIOlst; - displayer.GetActiveView()->GetVisible( anIOlst ); + window->GetVisible( anIOlst ); for ( SALOME_ListIteratorOfListIO It( anIOlst ); It.More(); It.Next() ) { Handle( SALOME_InteractiveObject ) io = It.Value(); @@ -525,8 +531,11 @@ void DisplayGUI::SetVerticesMode( const bool mode, SUIT_ViewWindow* viewWindow ) int aMgrId = viewWindow->getViewManager()->getGlobalId(); + SALOME_View* window = displayer.GetActiveView(); + if ( !window ) return; + SALOME_ListIO anIOlst; - displayer.GetActiveView()->GetVisible( anIOlst ); + window->GetVisible( anIOlst ); for ( SALOME_ListIteratorOfListIO It( anIOlst ); It.More(); It.Next() ) { Handle( SALOME_InteractiveObject ) io = It.Value(); @@ -571,8 +580,11 @@ void DisplayGUI::SetNameMode( const bool mode, SUIT_ViewWindow* viewWindow ) int aMgrId = viewWindow->getViewManager()->getGlobalId(); + SALOME_View* window = displayer.GetActiveView(); + if ( !window ) return; + SALOME_ListIO anIOlst; - displayer.GetActiveView()->GetVisible( anIOlst ); + window->GetVisible( anIOlst ); for ( SALOME_ListIteratorOfListIO It( anIOlst ); It.More(); It.Next() ) { Handle( SALOME_InteractiveObject ) io = It.Value(); diff --git a/src/GEOMGUI/GeometryGUI.cxx b/src/GEOMGUI/GeometryGUI.cxx index 3e90cd95a..790e65a7d 100644 --- a/src/GEOMGUI/GeometryGUI.cxx +++ b/src/GEOMGUI/GeometryGUI.cxx @@ -3082,8 +3082,11 @@ void UpdateNameMode( SalomeApp_Application* app ) GEOM_Displayer displayer( aStudy ); int aMgrId = viewWindow->getViewManager()->getGlobalId(); + SALOME_View* window = displayer.GetActiveView(); + if ( !window ) return; + SALOME_ListIO anIOlst; - displayer.GetActiveView()->GetVisible( anIOlst ); + window->GetVisible( anIOlst ); for ( SALOME_ListIteratorOfListIO It( anIOlst ); It.More(); It.Next() ) { Handle( SALOME_InteractiveObject ) io = It.Value();