From 69a69709756986d45ff4e9cd2b3c5f30fe738ca9 Mon Sep 17 00:00:00 2001 From: wmayer Date: Wed, 9 Dec 2015 13:18:58 +0100 Subject: [PATCH] + fix crash when undoing creation of spreadsheet --- src/App/Document.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/App/Document.cpp b/src/App/Document.cpp index 3988c3607..606f99db5 100644 --- a/src/App/Document.cpp +++ b/src/App/Document.cpp @@ -1903,11 +1903,13 @@ bool Document::_recomputeFeature(DocumentObject* Feat) void Document::recomputeFeature(DocumentObject* Feat) { // delete recompute log - for( std::vector::iterator it=_RecomputeLog.begin();it!=_RecomputeLog.end();++it) + for (std::vector::iterator it=_RecomputeLog.begin();it!=_RecomputeLog.end();++it) delete *it; _RecomputeLog.clear(); - _recomputeFeature(Feat); + // verify that the feature is (active) part of the document + if (Feat->getNameInDocument()) + _recomputeFeature(Feat); } DocumentObject * Document::addObject(const char* sType, const char* pObjectName) @@ -1928,7 +1930,7 @@ DocumentObject * Document::addObject(const char* sType, const char* pObjectName) pcObject->setDocument(this); // do no transactions if we do a rollback! - if(!d->rollback){ + if (!d->rollback) { // Transaction stuff if (d->activeTransaction) d->activeTransaction->addObjectNew(pcObject);