Salome HOME
Fix for bug IPAL9258(/dn06/../current1706): SIGSEGV after trying to close dialog...
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_SingleEditDlg.cxx
index 404d6a6d82a5e286bf4709e52ee0204b1e99e18e..fcf0682b49ef72c673973f5c70e453e60a7cb997 100755 (executable)
@@ -113,7 +113,6 @@ SMESHGUI_SingleEditDlg
          WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu),
     mySelector(SMESH::GetViewWindow(theModule)->GetSelector()),
     mySelectionMgr(SMESH::GetSelectionMgr(theModule)),
-    myViewWindow(SMESH::GetViewWindow(theModule)),
     mySMESHGUI(theModule)
 {
   QVBoxLayout* aDlgLay = new QVBoxLayout(this, MARGIN, SPACING);
@@ -240,7 +239,8 @@ void SMESHGUI_SingleEditDlg::Init()
   this->show();
 
   // set selection mode
-  myViewWindow->SetSelectionMode(EdgeOfCellSelection);
+  if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+    aViewWindow->SetSelectionMode(EdgeOfCellSelection);
 
   onSelectionDone();
 }
@@ -262,7 +262,8 @@ void SMESHGUI_SingleEditDlg::onOk()
 //=======================================================================
 void SMESHGUI_SingleEditDlg::onClose()
 {
-  myViewWindow->SetSelectionMode(ActorSelection);
+  if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+    aViewWindow->SetSelectionMode(ActorSelection);
   mySelectionMgr->clearSelected();
   disconnect(mySelectionMgr, 0, this, 0);
   disconnect(mySMESHGUI, 0, this, 0);
@@ -442,7 +443,8 @@ void SMESHGUI_SingleEditDlg::enterEvent (QEvent*)
 {
   if (!isEnabled()) {
     mySMESHGUI->EmitSignalDeactivateDialog();
-    myViewWindow->SetSelectionMode(EdgeOfCellSelection);
+    if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+      aViewWindow->SetSelectionMode(EdgeOfCellSelection);
     setEnabled(true);
   }
 }