diff options
author | Lars Knoll <lars.knoll@qt.io> | 2020-07-07 12:24:25 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2020-07-09 20:59:58 +0200 |
commit | aef0aac581fbbead07be939873e34045137b94ff (patch) | |
tree | 8c3ba5f67027a1c7fef1ce3e6bbfbc3379558af3 /src/qml/qml/ftw/qstringhash_p.h | |
parent | 03d039fcf255392d52b0fd4b6c47cedf546aa82f (diff) |
Compile against latest qtbase
Adjust to the lastest changes in QList and QString.
Change-Id: I216b2746a3305222a21c5aead3aec6106ac1f035
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/qml/ftw/qstringhash_p.h')
-rw-r--r-- | src/qml/qml/ftw/qstringhash_p.h | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/qml/qml/ftw/qstringhash_p.h b/src/qml/qml/ftw/qstringhash_p.h index 7a2184d63f..c4411b4814 100644 --- a/src/qml/qml/ftw/qstringhash_p.h +++ b/src/qml/qml/ftw/qstringhash_p.h @@ -78,7 +78,8 @@ public: , arrayData(mutableStringData(key).d_ptr()) , strData(mutableStringData(key).data()) { - arrayData->ref(); + if (arrayData) + arrayData->ref(); setQString(true); } @@ -93,7 +94,8 @@ public: setQString(o.isQString()); if (isQString()) { strData = o.strData; - arrayData->ref(); + if (arrayData) + arrayData->ref(); } else { ckey = o.ckey; } @@ -101,7 +103,7 @@ public: ~QStringHashNode() { - if (isQString() && !arrayData->deref()) + if (isQString() && arrayData && !arrayData->deref()) QTypedArrayData<char16_t>::deallocate(arrayData); } @@ -125,7 +127,8 @@ public: inline QHashedString key() const { if (isQString()) { - arrayData->ref(); + if (arrayData) + arrayData->ref(); return QHashedString(QString(QStringPrivate(arrayData, strData, length)), hash); } @@ -528,7 +531,8 @@ void QStringHash<T>::initializeNode(Node *node, const QHashedString &key) node->hash = key.hash(); node->arrayData = mutableStringData(key).d_ptr(); node->strData = mutableStringData(key).data(); - node->arrayData->ref(); + if (node->arrayData) + node->arrayData->ref(); node->setQString(true); } @@ -568,7 +572,8 @@ typename QStringHash<T>::Node *QStringHash<T>::takeNode(const Node &o) if (o.isQString()) { rv->strData = o.strData; rv->setQString(true); - rv->arrayData->ref(); + if (rv->arrayData) + rv->arrayData->ref(); } else { rv->ckey = o.ckey; } |