App: fix possible dangling pointer in Document::removeObject()

This commit is contained in:
wmayer
2022-08-22 11:15:14 +02:00
parent 00204dd6d4
commit 71015d23d0

View File

@@ -4215,6 +4215,10 @@ void Document::removeObject(const char* sName)
}
}
// In case the object gets deleted the pointer must be nullified
if (tobedestroyed) {
tobedestroyed->pcNameInDocument = nullptr;
}
d->objectMap.erase(pos);
}