From c960622b3d67c635534603c6c1453df1ec8b9e02 Mon Sep 17 00:00:00 2001 From: wmayer Date: Fri, 6 May 2022 20:34:08 +0200 Subject: [PATCH] App: fixes #6840: Crash in ObjectIdentifier::resolveProperty --- src/App/Document.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/App/Document.cpp b/src/App/Document.cpp index 3fa9a00395..47ec5d9ab2 100644 --- a/src/App/Document.cpp +++ b/src/App/Document.cpp @@ -1170,7 +1170,7 @@ void Document::_checkTransaction(DocumentObject* pcDelObj, const Property *What, return; } } - if(!pcDelObj) + if(!pcDelObj) return; // When the object is going to be deleted we have to check if it has already been added to // the undo transactions @@ -1647,6 +1647,7 @@ Document::~Document() for (auto it = d->objectMap.begin(); it != d->objectMap.end(); ++it) { it->second->setStatus(ObjectStatus::Destroy, true); delete(it->second); + it->second = nullptr; } // Remark: The API of Py::Object has been changed to set whether the wrapper owns the passed