Sketcher: Fix segfault when activating a tool in a different view
================================================================= When in Sketcher edit mode, a tool button is activated, while the view has been changing to view of a different type, it segfaults. This commit checks the pointer of the view to ensure correct type before activation, and refusing to activate if not of the correct type. fixes #10809
This commit is contained in:
committed by
abdullahtahiriyo
parent
2ea27064d5
commit
c7b99b9fbb
@@ -565,10 +565,13 @@ void ViewProviderSketch::purgeHandler()
|
||||
Gui::Selection().clearSelection();
|
||||
|
||||
// ensure that we are in sketch only selection mode
|
||||
Gui::MDIView* mdi = Gui::Application::Instance->editDocument()->getActiveView();
|
||||
Gui::View3DInventorViewer* viewer;
|
||||
viewer = static_cast<Gui::View3DInventor*>(mdi)->getViewer();
|
||||
viewer->setSelectionEnabled(false);
|
||||
auto* view = dynamic_cast<Gui::View3DInventor*>(Gui::Application::Instance->editDocument()->getActiveView());
|
||||
|
||||
if(view) {
|
||||
Gui::View3DInventorViewer* viewer;
|
||||
viewer = static_cast<Gui::View3DInventor*>(view)->getViewer();
|
||||
viewer->setSelectionEnabled(false);
|
||||
}
|
||||
}
|
||||
|
||||
void ViewProviderSketch::setAxisPickStyle(bool on)
|
||||
|
||||
Reference in New Issue
Block a user