App: make deleting dynamic property safer
Dynamic property can be removed at any time, even during triggering of onChanged() signal of the removing property. This patch introduced static function Property::destroy() to make it safer by queueing any removed property, and only deleting them when no onChanged() call is active.
This commit is contained in:
@@ -1010,7 +1010,7 @@ bool Document::redo(int id)
|
||||
|
||||
void Document::addOrRemovePropertyOfObject(TransactionalObject* obj, Property *prop, bool add)
|
||||
{
|
||||
if (!prop || !obj)
|
||||
if (!prop || !obj || !obj->isAttachedToDocument())
|
||||
return;
|
||||
if(d->iUndoMode && !isPerformingTransaction() && !d->activeUndoTransaction) {
|
||||
if(!testStatus(Restoring) || testStatus(Importing)) {
|
||||
|
||||
Reference in New Issue
Block a user