Thanks for pointing this out, it made me look again how this is working internally. In my case the listeners aren’t registered to the ValueTree itself but to Values that refer to CachedValues which in turn reference the properties of a ValueTree. After jumping through some hoops my call to
vt.copyPropertiesFrom(child, &undoManager); internally calls
Value::ValueSource::sendChangeMessage(false) which is async. Would be awesome if I could specify at the call side if I want this async or not - but I can’t. I also can’t specify this when obtaining the value.
I think adding
bool updateSynchronously like this would solve this issue:
template <typename Type>
inline Value CachedValue<Type>::getPropertyAsValue(bool
return targetTree.getPropertyAsValue (targetProperty, undoManager, updateSynchronously);