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:
parent
f4b60a0850
commit
5f5c4598fe
@ -165,9 +165,9 @@ Q_GLOBAL_STATIC(QMetaTypeCustomRegistry, customTypeRegistry)
|
|||||||
const char *QtMetaTypePrivate::typedefNameForType(const QtPrivate::QMetaTypeInterface *type_d)
|
const char *QtMetaTypePrivate::typedefNameForType(const QtPrivate::QMetaTypeInterface *type_d)
|
||||||
{
|
{
|
||||||
const char *name = nullptr;
|
const char *name = nullptr;
|
||||||
QMetaTypeCustomRegistry *r = customTypeRegistry;
|
if (!customTypeRegistry.exists())
|
||||||
if (!r)
|
|
||||||
return name;
|
return name;
|
||||||
|
QMetaTypeCustomRegistry *r = &*customTypeRegistry;
|
||||||
|
|
||||||
QByteArrayView officialName(type_d->name);
|
QByteArrayView officialName(type_d->name);
|
||||||
QReadLocker l(&r->lock);
|
QReadLocker l(&r->lock);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user