From 5cb793e253baee2033e45222989ec8cb18b2d869 Mon Sep 17 00:00:00 2001 From: mpv Date: Thu, 4 Oct 2018 16:47:51 +0300 Subject: [PATCH] Fix for the issue #2674 : Fatal error when undo remove part --- src/Model/Model_Objects.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Model/Model_Objects.cpp b/src/Model/Model_Objects.cpp index 35d3eaf1d..6fc21e71e 100644 --- a/src/Model/Model_Objects.cpp +++ b/src/Model/Model_Objects.cpp @@ -1988,11 +1988,12 @@ FeaturePtr Model_Objects::lastFeature() { Handle(TDataStd_ReferenceArray) aRefs; if (featuresLabel().FindAttribute(TDataStd_ReferenceArray::GetID(), aRefs)) { - FeaturePtr aLast = feature(aRefs->Value(aRefs->Upper())); + // comment this because of #2674 - features are removed from array on deactivation of Part + /*FeaturePtr aLast = feature(aRefs->Value(aRefs->Upper())); if (!aLast.get() && aRefs->Length() != 0) { // erase the invalid feature from the array RemoveFromRefArray(featuresLabel(), aRefs->Value(aRefs->Upper())); return lastFeature(); // try once again, after the last was removed - } + }*/ return feature(aRefs->Value(aRefs->Upper())); } return FeaturePtr(); // no features at all -- 2.39.2