Spreadsheet: Fixed bug with dangling pointer when a document object is deleted.

This commit is contained in:
Eivind Kvedalen 2015-08-04 11:35:10 +02:00 committed by wmayer
parent 4d1ebeccfa
commit bee11897a1
3 changed files with 8 additions and 0 deletions

View File

@ -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();

View File

@ -143,6 +143,8 @@ public:
void renamedDocument(const App::Document *doc);
void deletedDocumentObject(const App::DocumentObject *docObj);
void documentSet();
private:

View File

@ -60,6 +60,7 @@ void SheetObserver::slotCreatedObject(const DocumentObject &Obj)
void SheetObserver::slotDeletedObject(const DocumentObject &Obj)
{
sheet->invalidateDependants(&Obj);
sheet->deletedDocumentObject(&Obj);
}
/**