QProperties, when having a binding, have a dirty flag. When their dependencies change, they become dirty. On reevaluation, they become non-dirty again. That's the theory. Practice is, there are three possible states. In addition to "property is dirty and dirty flag is set" ("dirty" hereafter) and "property is non-dirty and dirty flag is not set" ("nondirty" hereafter), there is a third possible state which is "property is dirty and dirty flag is not yet set" ("transition" hereafter).
This transition state only occurs while the dirty states are propagated through the dependency graph. There would not be any problem if nothing else happened in this step. However, the eager evaluation feature leads to a problem. When any QProperty in the dependency graph does eager evaluation, it re-evaluates as soon as it is marked dirty. At the time it is marked dirty, other QProperties in the dependency graph might be in the transition state. These are then not re-evaluated because they don't know yet they are dirty, even though their content is dirty.
The problem can easily be reproduced, see the following code:
If properties hold pointers to objects, this might lead to use-after-free errors, as illustrated in the following example
A possible solution to this problem would be to not do any evaluation while propagating dirty states. In order to allow eager evaluation, we would need to introduce an additional step for potential eager evaluation. So, in pseudocode, where we have
we would need
That way, we could avoid having QProperties in transision state when performing eager evaluation.