fix crash when pressing cancel on pipe task panel

This commit is contained in:
wmayer 2017-01-24 15:00:41 +01:00
parent d9dda3fa1d
commit bebda4c6ad

View File

@ -88,10 +88,10 @@ TaskPipeParameters::TaskPipeParameters(ViewProviderPipe *PipeView,bool /*newObj*
this->groupLayout()->addWidget(proxy);
PartDesign::Pipe* pipe = static_cast<PartDesign::Pipe*>(PipeView->getObject());
Gui::Document* doc = Gui::Application::Instance->activeDocument();
Gui::Document* doc = PipeView->getDocument();
//make sure th euser sees al important things: the
//spine/auxillery spine he already selected
//make sure the user sees all important things: the
//spine/auxilliary spine he already selected
if (pipe->Spine.getValue()) {
auto* svp = doc->getViewProvider(pipe->Spine.getValue());
spineShow = svp->isShow();
@ -151,17 +151,20 @@ void TaskPipeParameters::onSelectionChanged(const Gui::SelectionChanges& msg)
TaskPipeParameters::~TaskPipeParameters()
{
if (vp) {
PartDesign::Pipe* pipe = static_cast<PartDesign::Pipe*>(vp->getObject());
Gui::Document* doc = Gui::Application::Instance->activeDocument();
Gui::Document* doc = vp->getDocument();
//make sure th euser sees al important things: the
//spine/auxillery spine he already selected
//make sure the user sees all important things: the
//spine/auxilliary spine he already selected
if (pipe->Spine.getValue()) {
auto* svp = doc->getViewProvider(pipe->Spine.getValue());
svp->setVisible(spineShow);
spineShow = false;
}
static_cast<ViewProviderPipe*>(vp)->highlightReferences(false, false);
}
delete ui;
}
@ -340,13 +343,14 @@ TaskPipeOrientation::TaskPipeOrientation(ViewProviderPipe* PipeView, bool /*newO
updateUI(pipe->Mode.getValue());
}
TaskPipeOrientation::~TaskPipeOrientation() {
TaskPipeOrientation::~TaskPipeOrientation()
{
if (vp) {
PartDesign::Pipe* pipe = static_cast<PartDesign::Pipe*>(vp->getObject());
Gui::Document* doc = Gui::Application::Instance->activeDocument();
Gui::Document* doc = vp->getDocument();
//make sure the user sees al important things: the base feature to select edges and the
//spine/auxillery spine he already selected
//spine/auxilliary spine he already selected
if (pipe->AuxillerySpine.getValue()) {
auto* svp = doc->getViewProvider(pipe->AuxillerySpine.getValue());
svp->setVisible(auxSpineShow);
@ -355,6 +359,7 @@ TaskPipeOrientation::~TaskPipeOrientation() {
static_cast<ViewProviderPipe*>(vp)->highlightReferences(false, true);
}
}
void TaskPipeOrientation::onOrientationChanged(int idx) {