Salome HOME
PAL9883 - default value of "ascii_file" parameter must be false
[modules/gui.git] / src / LightApp / LightApp_Application.cxx
index 3fc89457e44f16256717d3111ac913bc1753835e..d716f89ea11ce4004e56fbfd2a32a1fb43240d9f 100644 (file)
@@ -1150,11 +1150,10 @@ void LightApp_Application::onStudyClosed( SUIT_Study* )
 {
   emit studyClosed();
 
-  activateModule( "" );
+  // Bug 10396: clear selection
+  mySelMgr->clearSelected();
 
-  // Bug 10396: remove all selectors
-  delete mySelMgr;
-  mySelMgr = new LightApp_SelectionMgr( this );
+  activateModule( "" );
 
   saveWindowsGeometry();
 }
@@ -1609,7 +1608,11 @@ void LightApp_Application::preferencesChanged( const QString& sec, const QString
     int u = resMgr->integerValue( sec, "iso_number_u" );
     int v = resMgr->integerValue( sec, "iso_number_v" );
     for ( QPtrListIterator<SUIT_ViewManager> it( lst ); it.current(); ++it )
-      ((OCCViewer_Viewer*)it.current())->setIsos( u, v );
+    {
+      OCCViewer_ViewManager* mgr = dynamic_cast<OCCViewer_ViewManager*>( it.current() );
+      if( mgr && mgr->getOCCViewer() )
+       mgr->getOCCViewer()->setIsos( u, v );
+    }
   }
 
   if( sec=="ObjectBrowser" )
@@ -1855,3 +1858,12 @@ void LightApp_Application::onWCDestroyed( QObject* ob )
     break;
   }
 }
+
+/*! redefined to remove view manager from memory */
+void LightApp_Application::removeViewManager( SUIT_ViewManager* vm )
+{
+  disconnect( vm, SIGNAL( lastViewClosed( SUIT_ViewManager* ) ),
+           this, SLOT( onCloseView( SUIT_ViewManager* ) ) );
+  STD_Application::removeViewManager( vm );
+  delete vm;
+}