From: azv Date: Tue, 29 May 2018 11:52:09 +0000 (+0300) Subject: Fix crash on redoing IntersectionPoint X-Git-Tag: EDF_2018-1~33^2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=9be93bf2617cd8084077fce22912f1c28fba7b24;p=modules%2Fshaper.git Fix crash on redoing IntersectionPoint --- diff --git a/src/SketchPlugin/SketchPlugin_IntersectionPoint.cpp b/src/SketchPlugin/SketchPlugin_IntersectionPoint.cpp index e4feff995..be389af74 100644 --- a/src/SketchPlugin/SketchPlugin_IntersectionPoint.cpp +++ b/src/SketchPlugin/SketchPlugin_IntersectionPoint.cpp @@ -105,25 +105,28 @@ void SketchPlugin_IntersectionPoint::computePoint(const std::string& theID) for (std::list::iterator aPntIt = anIntersectionsPoints.begin(); aPntIt != anIntersectionsPoints.end(); ++aPntIt, ++aResultIndex) { std::shared_ptr aCurSketchPoint; - ResultConstructionPtr aCurResult; if (aExistInterIt == anExistentIntersections.end()) { - // create new point and result + // create new point aCurSketchPoint = std::dynamic_pointer_cast( sketch()->addFeature(SketchPlugin_Point::ID())); aCurSketchPoint->boolean(COPY_ID())->setValue(true); anIntersectionsList->append(aCurSketchPoint); + } else { + // update existent point + aCurSketchPoint = std::dynamic_pointer_cast(*aExistInterIt); + ++aExistInterIt; + } + ResultConstructionPtr aCurResult; + if (aResIt == aResults.end()) { + // create new result aCurResult = document()->createConstruction(data(), aResultIndex); aCurResult->setIsInHistory(false); aCurResult->setDisplayed(false); - } - else { - // update existent result point - aCurSketchPoint = std::dynamic_pointer_cast(*aExistInterIt); + } else { + // update existent result aCurResult = std::dynamic_pointer_cast(*aResIt); aCurResult->setShape(std::shared_ptr()); - - ++aExistInterIt; ++aResIt; }