QMetaType: don't create a registry just to query its emptiness [2/2]

The previous commit, b0e4d53b637e6c34457d14ed3f0be705098bf2f5, missed
this one. Same rationale as back then.

Pick-to: 6.4 6.3
Change-Id: Ibad4c130e0d61c64808275fa7b97b58ebd479acc
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Marc Mutz 2022-04-05 08:39:19 +02:00
parent f4b60a0850
commit 5f5c4598fe

View File

@ -165,9 +165,9 @@ Q_GLOBAL_STATIC(QMetaTypeCustomRegistry, customTypeRegistry)
const char *QtMetaTypePrivate::typedefNameForType(const QtPrivate::QMetaTypeInterface *type_d)
{
const char *name = nullptr;
QMetaTypeCustomRegistry *r = customTypeRegistry;
if (!r)
if (!customTypeRegistry.exists())
return name;
QMetaTypeCustomRegistry *r = &*customTypeRegistry;
QByteArrayView officialName(type_d->name);
QReadLocker l(&r->lock);