From 7f261745dc57cfa7b63077b5fd7d59e88f4072f9 Mon Sep 17 00:00:00 2001 From: dmv Date: Tue, 21 Jul 2009 12:28:19 +0000 Subject: [PATCH] Bug IPAL21228 SIGSEGV on exit from Salome with active GaussPointsDlg --- src/VISUGUI/VisuGUI_InputPane.cxx | 20 +++++++++++--------- src/VISUGUI/VisuGUI_Prs3dTools.h | 3 ++- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/VISUGUI/VisuGUI_InputPane.cxx b/src/VISUGUI/VisuGUI_InputPane.cxx index a4d95eda..cfa7c2af 100644 --- a/src/VISUGUI/VisuGUI_InputPane.cxx +++ b/src/VISUGUI/VisuGUI_InputPane.cxx @@ -234,17 +234,19 @@ VisuGUI_InputPane::VisuGUI_InputPane( VISU::VISUType theType, //--------------------------------------------------------------- VisuGUI_InputPane::~VisuGUI_InputPane() { - LightApp_SelectionMgr* aSelectionMgr = VISU::GetSelectionMgr(myModule); + if ( myModule->getApp() ) { + LightApp_SelectionMgr* aSelectionMgr = VISU::GetSelectionMgr(myModule); + + if (myFieldFilter) + { + aSelectionMgr->removeFilter(myFieldFilter); + delete myFieldFilter; + } - if (myFieldFilter) - { - aSelectionMgr->removeFilter(myFieldFilter); - delete myFieldFilter; + // Restore initial selection + if(isRestoreInitialSelection) + aSelectionMgr->setSelectedObjects(mySavedSelection); } - - // Restore initial selection - if(isRestoreInitialSelection) - aSelectionMgr->setSelectedObjects(mySavedSelection); } void VisuGUI_InputPane::SetRestoreInitialSelection(bool on){ diff --git a/src/VISUGUI/VisuGUI_Prs3dTools.h b/src/VISUGUI/VisuGUI_Prs3dTools.h index 76b11fce..c9864171 100644 --- a/src/VISUGUI/VisuGUI_Prs3dTools.h +++ b/src/VISUGUI/VisuGUI_Prs3dTools.h @@ -252,7 +252,8 @@ namespace VISU QApplication::restoreOverrideCursor(); delete aDlg; } else { - DeletePrs3d(theModule,aPrs3d); + if ( theModule->application() ) + DeletePrs3d(theModule,aPrs3d); QApplication::restoreOverrideCursor(); delete aDlg; return NULL; -- 2.39.2