diff --git a/src/App/Document.cpp b/src/App/Document.cpp index 699c6e0446..6dbe424fac 100644 --- a/src/App/Document.cpp +++ b/src/App/Document.cpp @@ -2596,7 +2596,6 @@ void Document::remObject(const char* sName) } signalDeletedObject(*(pos->second)); - pos->second->setStatus(ObjectStatus::Delete, false); // Unset the bit to be on the safe side // do no transactions if we do a rollback! if (!d->rollback && d->activeUndoTransaction) { @@ -2651,6 +2650,8 @@ void Document::remObject(const char* sName) // remove from adjancy list //remove_vertex(_DepConMap[pos->second],_DepList); //_DepConMap.erase(pos->second); + + pos->second->setStatus(ObjectStatus::Delete, false); // Unset the bit to be on the safe side d->objectMap.erase(pos); } diff --git a/src/Gui/ViewProviderGeoFeatureGroupExtension.cpp b/src/Gui/ViewProviderGeoFeatureGroupExtension.cpp index 0e9187e9d3..d5cc0b54d8 100644 --- a/src/Gui/ViewProviderGeoFeatureGroupExtension.cpp +++ b/src/Gui/ViewProviderGeoFeatureGroupExtension.cpp @@ -76,8 +76,16 @@ std::vector ViewProviderGeoFeatureGroupExtension::extensio std::vector claim; auto objs = ext->Group.getValues(); - for(auto obj : objs) { - if(obj->getInList().size()<=1) + for(auto obj : objs) { + + auto vin = obj->getInList(); + + //we don't want to count objects that are deleted + vin.erase(std::remove_if(vin.begin(), vin.end(), [](App::DocumentObject* obj)->bool { + return obj->isDeleting(); + }), vin.end()); + + if(vin.size()<=1) claim.push_back(obj); } return claim;