Spreadsheet: Fixed bug with dangling pointer when a document object is deleted.
This commit is contained in:
parent
4d1ebeccfa
commit
bee11897a1
|
@ -1089,6 +1089,11 @@ void PropertySheet::renamedDocument(const App::Document * doc)
|
|||
}
|
||||
}
|
||||
|
||||
void PropertySheet::deletedDocumentObject(const App::DocumentObject *docObj)
|
||||
{
|
||||
docDeps.erase(const_cast<App::DocumentObject*>(docObj));
|
||||
}
|
||||
|
||||
void PropertySheet::documentSet()
|
||||
{
|
||||
documentName[owner->getDocument()] = owner->getDocument()->Label.getValue();
|
||||
|
|
|
@ -143,6 +143,8 @@ public:
|
|||
|
||||
void renamedDocument(const App::Document *doc);
|
||||
|
||||
void deletedDocumentObject(const App::DocumentObject *docObj);
|
||||
|
||||
void documentSet();
|
||||
|
||||
private:
|
||||
|
|
|
@ -60,6 +60,7 @@ void SheetObserver::slotCreatedObject(const DocumentObject &Obj)
|
|||
void SheetObserver::slotDeletedObject(const DocumentObject &Obj)
|
||||
{
|
||||
sheet->invalidateDependants(&Obj);
|
||||
sheet->deletedDocumentObject(&Obj);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue
Block a user