From: nds Date: Mon, 7 Sep 2015 13:20:18 +0000 (+0300) Subject: #878 Segmentation fault when setting distance on the two same points X-Git-Tag: V_1.4.0_beta4~89 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=20d233731eaae06b9a75280a2ca675bc9a11cc72;p=modules%2Fshaper.git #878 Segmentation fault when setting distance on the two same points Crash by click in the same point, caused by OCCT dir2d --- diff --git a/src/SketchPlugin/SketchPlugin_ConstraintDistance.cpp b/src/SketchPlugin/SketchPlugin_ConstraintDistance.cpp index 6b1dd6bec..7eeee4267 100644 --- a/src/SketchPlugin/SketchPlugin_ConstraintDistance.cpp +++ b/src/SketchPlugin/SketchPlugin_ConstraintDistance.cpp @@ -277,6 +277,9 @@ void SketchPlugin_ConstraintDistance::attributeChanged(const std::string& theID) } else return; + if (aEndPnt->distance(aStartPnt) < tolerance) + return; + std::shared_ptr aLineDir(new GeomAPI_Dir2d(aEndPnt->decreased(aStartPnt))); std::shared_ptr aFlyoutDir = aFlyoutPnt->xy()->decreased(aStartPnt);