]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
Fight memory leaks
authorvsr <vsr@opencascade.com>
Wed, 22 Oct 2014 14:22:21 +0000 (18:22 +0400)
committervsr <vsr@opencascade.com>
Wed, 22 Oct 2014 14:22:21 +0000 (18:22 +0400)
src/DependencyTree/DependencyTree_ViewModel.cxx

index e191cad1a537077a23d0f329a73c3c6064c54569..750de6f800813b9bb2f1fe901a61421c6da00a1d 100644 (file)
@@ -67,7 +67,7 @@ void DependencyTree_ViewModel::onShowSelected()
   aSelMgr->selectedObjects(aSelList);
 
   SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
-  GEOM_Displayer* disp = new GEOM_Displayer( appStudy );
+  GEOM_Displayer disp( appStudy );
 
   OCCViewer_ViewManager* anOCCVM = ( OCCViewer_ViewManager* ) app->getViewManager( OCCViewer_Viewer::Type(), /*create=*/ true );
 
@@ -75,7 +75,7 @@ void DependencyTree_ViewModel::onShowSelected()
     if ( SALOME_View* viewFrame = dynamic_cast<SALOME_View*>( viewModel ) ) {
       SALOME_ListIteratorOfListIO Iter( aSelList );
       for ( ; Iter.More(); Iter.Next() )
-        disp->Display( Iter.Value(), false, viewFrame );
+        disp.Display( Iter.Value(), false, viewFrame );
       viewFrame->Repaint();
     }
   }
@@ -97,16 +97,16 @@ void DependencyTree_ViewModel::onShowOnlySelected()
   aSelMgr->selectedObjects( aSelList );
 
   SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
-  GEOM_Displayer* disp = new GEOM_Displayer( appStudy );
+  GEOM_Displayer disp( appStudy );
 
   OCCViewer_ViewManager* anOCCVM = (OCCViewer_ViewManager*) app->getViewManager( OCCViewer_Viewer::Type(), /*create=*/ true );
 
   if ( SUIT_ViewModel* viewModel = anOCCVM->getViewModel() ) {
     if ( SALOME_View* viewFrame = dynamic_cast<SALOME_View*>( viewModel ) ) {
-      disp->EraseAll( true, false, viewFrame );
+      disp.EraseAll( true, false, viewFrame );
       SALOME_ListIteratorOfListIO Iter( aSelList );
       for ( ; Iter.More(); Iter.Next() )
-        disp->Display( Iter.Value(), false, viewFrame );
+        disp.Display( Iter.Value(), false, viewFrame );
       viewFrame->Repaint();
     }
   }