From 480d23f8e1de5a7291c6c114fd4fd65f6321da92 Mon Sep 17 00:00:00 2001 From: Abdullah Tahiri Date: Fri, 19 Jun 2015 13:56:14 +0200 Subject: [PATCH] Sketcher: Bug fix: Unexpected crashes during certain operations =============================================================== The sketcher crashed for example during effecting a fillet operation. Cause: The ElementsWidget/ConstraintWidget was being updated as a consequence of adding/removing geometry/constraints, and it was effecting a selection after the update, in cases where the geometry in the screen was not being redraw (because the sketchobject was still unsolved), therefore trying to select an element that according to ViewProvider did not exist (as it is created during redraw). Solution: Widgets update when their properties changes, provided that a redraw is effected (which actually also saves some (negligible) time, as they are only updated when they should). --- src/Mod/Sketcher/Gui/ViewProviderSketch.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp b/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp index d38a2b5f0..261bf6406 100644 --- a/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp +++ b/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp @@ -4094,16 +4094,18 @@ void ViewProviderSketch::updateData(const App::Property *prop) getSketchObject()->getSolvedSketch().getGeometrySize()) { UpdateSolverInformation(); // just update the solver window with the last SketchObject solving information draw(false); + + if (edit && &(getSketchObject()->Constraints)) { + // send the signal for the TaskDlg. + signalConstraintsChanged(); + } + if (edit && &(getSketchObject()->Geometry)) { + // send the signal for the TaskDlg. + signalElementsChanged(); + } + } } - if (edit && &(getSketchObject()->Constraints)) { - // send the signal for the TaskDlg. - signalConstraintsChanged(); - } - if (edit && &(getSketchObject()->Geometry)) { - // send the signal for the TaskDlg. - signalElementsChanged(); - } } void ViewProviderSketch::onChanged(const App::Property *prop)