]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
54519: [TC-9.3.0]: SIGSEGV during exit if dimensions are editing
authorrnv <rnv@opencascade.com>
Fri, 22 Mar 2019 07:59:36 +0000 (10:59 +0300)
committerrnv <rnv@opencascade.com>
Fri, 22 Mar 2019 07:59:36 +0000 (10:59 +0300)
src/MeasureGUI/MeasureGUI_DimensionInteractor.cxx
src/MeasureGUI/MeasureGUI_DimensionInteractor.h
src/MeasureGUI/MeasureGUI_ManageDimensionsDlg.cxx

index a41e49487d8debeecd7f5ba04d142eb29b7f8039..0777440a2960f53632014cf11dded68cd026bf5b 100644 (file)
@@ -132,12 +132,14 @@ void MeasureGUI_DimensionInteractor::Disable()
 
   myIsEnabled = false;
 
-  // remove event filtering from viewer windows
-  QVector<SUIT_ViewWindow*>           aViews  = myVM->getViews();
-  QVector<SUIT_ViewWindow*>::iterator aViewIt = aViews.begin();
-  for ( ; aViewIt != aViews.end(); ++aViewIt )
-  {
-    DisconnectView( *aViewIt );
+  if (myVM) {
+    // remove event filtering from viewer windows
+    QVector<SUIT_ViewWindow*>           aViews  = myVM->getViews();
+    QVector<SUIT_ViewWindow*>::iterator aViewIt = aViews.begin();
+    for ( ; aViewIt != aViews.end(); ++aViewIt )
+    {
+      DisconnectView( *aViewIt );
+    }
   }
 }
 
index 9343a98175fe3ae44b113306962228d1955a8bec..cde51bafdb434128ec6034717a1125509cc32359 100644 (file)
@@ -29,6 +29,7 @@
 
 #include <GeometryGUI.h>
 #include <QObject>
+#include <QPointer>
 
 #include <SelectMgr_EntityOwner.hxx>
 #include <NCollection_Sequence.hxx>
@@ -165,7 +166,7 @@ private:
 private:
   GeometryGUI*            myGeomGUI;
   bool                    myIsEnabled;
-  OCCViewer_ViewManager*  myVM;
+  QPointer<OCCViewer_ViewManager> myVM;
   OCCViewer_Viewer*       myViewer;
   Operation               myOperation;
   bool                    myOperationStarted;
index de58cbcff8f5573fff821e3a49b52813126e57f2..49a3f14787b55de4a5cc09aacdf6f3eeafa97516 100644 (file)
@@ -129,7 +129,7 @@ MeasureGUI_ManageDimensionsDlg::MeasureGUI_ManageDimensionsDlg( GeometryGUI* the
   connect( myGeomGUI, SIGNAL( SignalDeactivateActiveDialog() ), this, SLOT( OnDeactivateThisDialog() ) );
   connect( myGeomGUI, SIGNAL( SignalCloseAllDialogs() ),        this, SLOT( ClickOnCancel() ) );
 
-  myDimensionInteractor = new MeasureGUI_DimensionInteractor( theGUI, theParent ),
+  myDimensionInteractor = new MeasureGUI_DimensionInteractor( theGUI, this ),
 
   SelectionIntoArgument( Selection_Object );
 
@@ -245,6 +245,9 @@ void MeasureGUI_ManageDimensionsDlg::StartSelection( const Selection theSelectio
 //=================================================================================
 void MeasureGUI_ManageDimensionsDlg::StopSelection()
 {
+  if( !myGeomGUI || !myGeomGUI->getApp() || !myGeomGUI->getApp()->selectionMgr() )
+    return;
+
   if ( myCurrentSelection == Selection_Object )
   {
     /* -----------------------------------------------  *