diff options
-rw-r--r-- | src/corelib/kernel/qproperty.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/corelib/kernel/qproperty.cpp b/src/corelib/kernel/qproperty.cpp index 9ca290d879..6a129daa7a 100644 --- a/src/corelib/kernel/qproperty.cpp +++ b/src/corelib/kernel/qproperty.cpp @@ -2318,8 +2318,10 @@ bool isAnyBindingEvaluating() bool isPropertyInBindingWrapper(const QUntypedPropertyData *property) { - return bindingStatus.currentCompatProperty && - bindingStatus.currentCompatProperty->property == property; + // Accessing bindingStatus is expensive because it's thread-local. Do it only once. + if (const auto current = bindingStatus.currentCompatProperty) + return current->property == property; + return false; } namespace BindableWarnings { |