From: vsr Date: Wed, 22 Oct 2014 14:22:21 +0000 (+0400) Subject: Fight memory leaks X-Git-Tag: V7_5_0b1~10 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=62283977ac7aed96501b90441b7b2f7f9b96a00b;p=modules%2Fgeom.git Fight memory leaks --- diff --git a/src/DependencyTree/DependencyTree_ViewModel.cxx b/src/DependencyTree/DependencyTree_ViewModel.cxx index e191cad1a..750de6f80 100644 --- a/src/DependencyTree/DependencyTree_ViewModel.cxx +++ b/src/DependencyTree/DependencyTree_ViewModel.cxx @@ -67,7 +67,7 @@ void DependencyTree_ViewModel::onShowSelected() aSelMgr->selectedObjects(aSelList); SalomeApp_Study* appStudy = dynamic_cast( 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( 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( 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( 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(); } }