issue #0002836: Crash in sketcher
This commit is contained in:
@@ -220,7 +220,11 @@ TaskBoxPrimitives::TaskBoxPrimitives(ViewProviderPrimitive* vp, QWidget* parent)
|
||||
if(i != index)
|
||||
ui.widgetStack->widget(i)->setSizePolicy(QSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored));
|
||||
}
|
||||
|
||||
|
||||
Gui::Document* doc = vp->getDocument();
|
||||
this->attachDocument(doc);
|
||||
this->enableNotifications(DocumentObserver::Delete);
|
||||
|
||||
//show the parts coordinate system axis for selection
|
||||
PartDesign::Body * body = PartDesign::Body::findBodyOf(vp->getObject());
|
||||
if(body) {
|
||||
@@ -241,8 +245,8 @@ TaskBoxPrimitives::TaskBoxPrimitives(ViewProviderPrimitive* vp, QWidget* parent)
|
||||
TaskBoxPrimitives::~TaskBoxPrimitives()
|
||||
{
|
||||
//hide the parts coordinate system axis for selection
|
||||
PartDesign::Body * body = PartDesign::Body::findBodyOf ( vp->getObject() );
|
||||
if(body) {
|
||||
PartDesign::Body * body = vp ? PartDesign::Body::findBodyOf(vp->getObject()) : 0;
|
||||
if (body) {
|
||||
try {
|
||||
App::Origin *origin = body->getOrigin();
|
||||
Gui::ViewProviderOrigin* vpOrigin;
|
||||
@@ -254,6 +258,12 @@ TaskBoxPrimitives::~TaskBoxPrimitives()
|
||||
}
|
||||
}
|
||||
|
||||
void TaskBoxPrimitives::slotDeletedObject(const Gui::ViewProviderDocumentObject& Obj)
|
||||
{
|
||||
if (this->vp == &Obj)
|
||||
this->vp = nullptr;
|
||||
}
|
||||
|
||||
void TaskBoxPrimitives::onBoxHeightChanged(double v) {
|
||||
PartDesign::Box* box = static_cast<PartDesign::Box*>(vp->getObject());
|
||||
box->Height.setValue(v);
|
||||
|
||||
Reference in New Issue
Block a user