diff --git a/src/corelib/kernel/qmetatype.cpp b/src/corelib/kernel/qmetatype.cpp index c0bc82ed29..cd71805e12 100644 --- a/src/corelib/kernel/qmetatype.cpp +++ b/src/corelib/kernel/qmetatype.cpp @@ -2580,7 +2580,8 @@ static inline int qMetaTypeStaticType(const char *typeName, int length) */ static int qMetaTypeCustomType_unlocked(const char *typeName, int length) { - if (auto reg = customTypeRegistry()) { + if (customTypeRegistry.exists()) { + auto reg = &*customTypeRegistry; #if QT_CONFIG(thread) Q_ASSERT(!reg->lock.tryLockForWrite()); #endif @@ -2980,8 +2981,8 @@ static const QtPrivate::QMetaTypeInterface *interfaceForType(int typeId) { const QtPrivate::QMetaTypeInterface *iface = nullptr; if (typeId >= QMetaType::User) { - if (auto reg = customTypeRegistry()) - iface = reg->getCustomType(typeId); + if (customTypeRegistry.exists()) + iface = customTypeRegistry->getCustomType(typeId); } else { if (auto moduleHelper = qModuleHelperForType(typeId)) iface = moduleHelper->interfaceForType(typeId);