From: mpv Date: Wed, 27 May 2015 17:01:11 +0000 (+0300) Subject: Fix for highlight external objects for "distance" in sketch crash X-Git-Tag: V_1.2.0~44 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=4951631c9a136319e0420533465c1539581301ec;p=modules%2Fshaper.git Fix for highlight external objects for "distance" in sketch crash --- diff --git a/src/Model/Model_Document.cpp b/src/Model/Model_Document.cpp index 8cc427ce8..517b4231f 100644 --- a/src/Model/Model_Document.cpp +++ b/src/Model/Model_Document.cpp @@ -642,6 +642,8 @@ int Model_Document::size(const std::string& theGroupID) std::shared_ptr Model_Document::currentFeature(const bool theVisible) { + if (!myObjs) // on close document feature destruction it may call this method + return std::shared_ptr(); TDF_Label aRefLab = generalLabel().FindChild(TAG_CURRENT_FEATURE); Handle(TDF_Reference) aRef; if (aRefLab.FindAttribute(TDF_Reference::GetID(), aRef)) { @@ -734,10 +736,12 @@ void Model_Document::setCurrentFeature(std::shared_ptr theCurr void Model_Document::setCurrentFeatureUp() { - FeaturePtr aCurrent = currentFeature(true); + // on remove just go up for minimum step: highlight external objects in sketch causes + // problems if it is true: here and in "setCurrentFeature" + FeaturePtr aCurrent = currentFeature(false); if (aCurrent.get()) { // if not, do nothing because null is the upper FeaturePtr aPrev = myObjs->nextFeature(aCurrent, true); - setCurrentFeature(aPrev, true); + setCurrentFeature(aPrev, false); } }