//---------------------------------------------------------------
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){
QApplication::restoreOverrideCursor();
delete aDlg;
} else {
- DeletePrs3d(theModule,aPrs3d);
+ if ( theModule->application() )
+ DeletePrs3d(theModule,aPrs3d);
QApplication::restoreOverrideCursor();
delete aDlg;
return NULL;