From: dmv Date: Mon, 7 Jul 2008 12:00:01 +0000 (+0000) Subject: Bug IPAL19197 4x POST-001: Segmentation violation at attempt to display Deformed... X-Git-Tag: V4_1_0_maintainance_20080710~3 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=f3674eb2206d7c2b5bd7ecc5ea07b05830bfcd9b;p=modules%2Fvisu.git Bug IPAL19197 4x POST-001: Segmentation violation at attempt to display Deformed Shape --- diff --git a/src/VISUGUI/VisuGUI_DeformedShapeDlg.cxx b/src/VISUGUI/VisuGUI_DeformedShapeDlg.cxx index ae92e5b3..9bc7ccac 100644 --- a/src/VISUGUI/VisuGUI_DeformedShapeDlg.cxx +++ b/src/VISUGUI/VisuGUI_DeformedShapeDlg.cxx @@ -286,27 +286,29 @@ void VisuGUI_DeformedShapeDlg::CreatePrs3d(VisuGUI* theModule) aFieldName.latin1(), aTimeStampId.toInt(), aPublishInStudyMode); - - VisuGUI_DeformedShapeDlg* aDlg = new VisuGUI_DeformedShapeDlg (theModule); - aDlg->initFromPrsObject(aPrs3d, true); - aDlg->UseMagn->setChecked(true); - VisuGUI_DialogRunner r(aDlg); - int dlgResult = r.run( false ); - - if ( dlgResult == 0 ) - DeletePrs3d(theModule,aPrs3d); - else { - aDlg->storeToPrsObject( aPrs3d ); - SVTK_ViewWindow* aViewWindow = VISU::GetActiveViewWindow(); - PublishInView(theModule, aPrs3d, aViewWindow); - if(VISU::GetResourceMgr()->booleanValue("VISU","automatic_fit_all",false)) - aViewWindow->onFitAll(); - int aPos = VISU::GetFreePositionOfDefaultScalarBar(theModule, aViewWindow); - VISU::AddScalarBarPosition(theModule, aViewWindow, aPrs3d, aPos); + + if (aPrs3d) { + VisuGUI_DeformedShapeDlg* aDlg = new VisuGUI_DeformedShapeDlg (theModule); + aDlg->initFromPrsObject(aPrs3d, true); + aDlg->UseMagn->setChecked(true); + VisuGUI_DialogRunner r(aDlg); + int dlgResult = r.run( false ); + + if ( dlgResult == 0 ) + DeletePrs3d(theModule,aPrs3d); + else { + aDlg->storeToPrsObject( aPrs3d ); + SVTK_ViewWindow* aViewWindow = VISU::GetActiveViewWindow(); + PublishInView(theModule, aPrs3d, aViewWindow); + if(VISU::GetResourceMgr()->booleanValue("VISU","automatic_fit_all",false)) + aViewWindow->onFitAll(); + int aPos = VISU::GetFreePositionOfDefaultScalarBar(theModule, aViewWindow); + VISU::AddScalarBarPosition(theModule, aViewWindow, aPrs3d, aPos); + } + + VISU::UpdateObjBrowser(theModule, true, aTimeStamp); + delete aDlg; } - - VISU::UpdateObjBrowser(theModule, true, aTimeStamp); - delete aDlg; } } }