From 62283977ac7aed96501b90441b7b2f7f9b96a00b Mon Sep 17 00:00:00 2001 From: vsr Date: Wed, 22 Oct 2014 18:22:21 +0400 Subject: [PATCH] Fight memory leaks --- src/DependencyTree/DependencyTree_ViewModel.cxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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(); } } -- 2.39.2