From 80920a3012239644ac0aba8c37a9a05e22e34b5a Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Wed, 6 Feb 2019 16:06:39 +0100 Subject: Use QQmlRefCount for QQmlType(Private) As we already have an implementation of refcounting, we can just use that intead of inventing another one. This also gives us nice move ctors and operators. Also, use const pointers to QQmlTypePrivate where possible. This exposes quite some nastiness that needs to be fixed in follow-up commits: All the mutable members of QQmlTypePrivate are unsafe for multithreaded use. Change-Id: I3be8f2c53d86e06ffa80c8df8830473fe6d1d91d Reviewed-by: Simon Hausmann --- src/qml/qml/qqmlmetatype.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/qml/qml/qqmlmetatype.cpp') diff --git a/src/qml/qml/qqmlmetatype.cpp b/src/qml/qml/qqmlmetatype.cpp index a034d72221..0da96f61e4 100644 --- a/src/qml/qml/qqmlmetatype.cpp +++ b/src/qml/qml/qqmlmetatype.cpp @@ -1220,7 +1220,7 @@ void QQmlMetaType::freeUnusedTypesAndCaches() QList::Iterator it = data->types.begin(); while (it != data->types.end()) { const QQmlTypePrivate *d = (*it).priv(); - if (d && d->refCount == 1) { + if (d && d->count() == 1) { deletedAtLeastOneType = true; removeQQmlTypePrivate(data->idToType, d); -- cgit v1.2.3