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 );
+ }
}
}
#include <GeometryGUI.h>
#include <QObject>
+#include <QPointer>
#include <SelectMgr_EntityOwner.hxx>
#include <NCollection_Sequence.hxx>
private:
GeometryGUI* myGeomGUI;
bool myIsEnabled;
- OCCViewer_ViewManager* myVM;
+ QPointer<OCCViewer_ViewManager> myVM;
OCCViewer_Viewer* myViewer;
Operation myOperation;
bool myOperationStarted;
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 );
//=================================================================================
void MeasureGUI_ManageDimensionsDlg::StopSelection()
{
+ if( !myGeomGUI || !myGeomGUI->getApp() || !myGeomGUI->getApp()->selectionMgr() )
+ return;
+
if ( myCurrentSelection == Selection_Object )
{
/* ----------------------------------------------- *