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

This commit is contained in:
wmayer
2022-09-11 22:15:43 +02:00
committed by Uwe
parent 44783edf98
commit 5b9cfb2d32
+4
View File
@@ -4225,6 +4225,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);
}