From: mpv Date: Mon, 26 May 2014 09:36:17 +0000 (+0400) Subject: Updates for stability of application X-Git-Tag: V_0.2~5 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=4ee6972a725f02500c2c543abeef2909180e09c1;p=modules%2Fshaper.git Updates for stability of application --- diff --git a/src/Model/Model_Document.cpp b/src/Model/Model_Document.cpp index 6f3b4a7a9..76b72fe0c 100644 --- a/src/Model/Model_Document.cpp +++ b/src/Model/Model_Document.cpp @@ -577,7 +577,7 @@ boost::shared_ptr Model_Document::objectByFeature( for(int a = 0; a < size(theFeature->getGroup()); a++) { boost::shared_ptr anObj = boost::dynamic_pointer_cast(feature(theFeature->getGroup(), a)); - if (anObj) { + if (anObj && anObj->featureRef() == theFeature) { return anObj; } } diff --git a/src/SketchSolver/SketchSolver_ConstraintManager.cpp b/src/SketchSolver/SketchSolver_ConstraintManager.cpp index 7edc1da33..80a1b4872 100644 --- a/src/SketchSolver/SketchSolver_ConstraintManager.cpp +++ b/src/SketchSolver/SketchSolver_ConstraintManager.cpp @@ -771,8 +771,11 @@ void SketchSolver_ConstraintManager::SketchSolver_ConstraintGroup::mergeGroups( std::map, Slvs_hEntity>::const_iterator aSPEntMapIter = theGroup.myEntityMap.begin(); - for ( ; aSPEntMapIter != theGroup.myEntityMap.end(); aSPEntMapIter++) - myEntityMap[aSPEntMapIter->first] = anEntityMap.find(aSPEntMapIter->second)->second; + for ( ; aSPEntMapIter != theGroup.myEntityMap.end(); aSPEntMapIter++) { + std::map::iterator aFind = anEntityMap.find(aSPEntMapIter->second); + if (aFind != anEntityMap.end()) + myEntityMap[aSPEntMapIter->first] = aFind->second; + } // Add temporary constraints std::list::const_iterator aTempConstrIter = theGroup.myTempConstraints.begin();