Fix crash when user click 'Close' button while Dimension is active.
TaskDlgEditSketch didn't purge the handler first as is doing CmdSketcherLeaveSketch.
This commit is contained in:
@@ -1061,7 +1061,6 @@ public:
|
||||
void deactivated() override
|
||||
{
|
||||
Gui::Command::abortCommand();
|
||||
//TODO: When user exit sketch edit while tool is activated solve() crashes. solve is needed to refresh the sketch after abortCommand
|
||||
Obj->solve();
|
||||
sketchgui->draw(false, false); // Redraw
|
||||
}
|
||||
|
||||
@@ -100,6 +100,10 @@ bool TaskDlgEditSketch::reject()
|
||||
hGrp->SetBool("ExpandedConstraintsWidget", Constraints->isGroupVisible());
|
||||
hGrp->SetBool("ExpandedElementsWidget", Elements->isGroupVisible());
|
||||
|
||||
if (sketchView && sketchView->getSketchMode() != ViewProviderSketch::STATUS_NONE) {
|
||||
sketchView->purgeHandler();
|
||||
}
|
||||
|
||||
std::string document = getDocumentName();// needed because resetEdit() deletes this instance
|
||||
Gui::Command::doCommand(
|
||||
Gui::Command::Gui, "Gui.getDocument('%s').resetEdit()", document.c_str());
|
||||
|
||||
Reference in New Issue
Block a user