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:
Zheng, Lei
2020-03-21 15:43:03 +01:00
committed by wmayer
parent 1102195a9a
commit d441a9ded5
4 changed files with 46 additions and 2 deletions
+1 -1
View File
@@ -215,7 +215,7 @@ bool DynamicProperty::removeDynamicProperty(const char* name)
throw Base::RuntimeError("property is not dynamic");
Property *prop = it->property;
GetApplication().signalRemoveDynamicProperty(*prop);
delete prop;
Property::destroy(prop);
index.erase(it);
return true;
}