From 1241752b9419f118d52229da9ee354cf61e8b551 Mon Sep 17 00:00:00 2001 From: wmayer Date: Mon, 22 Feb 2021 17:31:25 +0100 Subject: [PATCH] App: [skip ci] check object status before accessing back links --- src/App/PropertyLinks.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/App/PropertyLinks.cpp b/src/App/PropertyLinks.cpp index c151d2b4eb..44b79a607c 100644 --- a/src/App/PropertyLinks.cpp +++ b/src/App/PropertyLinks.cpp @@ -4618,10 +4618,14 @@ void PropertyXLinkContainer::clearDeps() { auto owner = dynamic_cast(getContainer()); if(!owner || !owner->getNameInDocument()) return; - for(auto obj : _Deps) { - if(obj && obj->getNameInDocument() && obj->getDocument()==owner->getDocument()) - obj->_removeBackLink(owner); +#ifndef USE_OLD_DAG + if (!owner->testStatus(ObjectStatus::Destroy)) { + for(auto obj : _Deps) { + if(obj && obj->getNameInDocument() && obj->getDocument()==owner->getDocument()) + obj->_removeBackLink(owner); + } } +#endif _Deps.clear(); _XLinks.clear(); _LinkRestored = false;