OSDN Git Service

move custom metatypes access to the scope it is used in
authorIvailo Monev <xakepa10@laimg.moc>
Sun, 12 May 2019 20:48:04 +0000 (20:48 +0000)
committerIvailo Monev <xakepa10@laimg.moc>
Sun, 12 May 2019 20:48:04 +0000 (20:48 +0000)
Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
src/core/kernel/qmetatype.cpp

index 0604804..1a3bcba 100644 (file)
@@ -1388,7 +1388,6 @@ void QMetaType::destroy(int type, void *data)
     case QMetaType::Void:
         break;
     default: {
-        const QVector<QCustomTypeInfo> * const ct = customTypes();
         Destructor destr = 0;
         if (type >= FirstGuiType && type <= LastGuiType) {
             Q_ASSERT(qMetaTypeGuiHelper);
@@ -1397,6 +1396,7 @@ void QMetaType::destroy(int type, void *data)
                 return;
             destr = qMetaTypeGuiHelper[type - FirstGuiType].destr;
         } else {
+            const QVector<QCustomTypeInfo> * const ct = customTypes();
             QReadLocker locker(customTypesLock());
             if (type < User || !ct || ct->count() <= type - User)
                 break;