Eradicate Java-style iterators and mark the module clean

Change-Id: I81ef72c1cdd589ccedfd7141116df50a49bb1622
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
This commit is contained in:
Marc Mutz 2019-05-16 09:20:43 +02:00
parent 0570d73b61
commit d38db1a6b5
2 changed files with 5 additions and 4 deletions

View File

@ -4,5 +4,6 @@ QT3D_BUILD_ROOT = $$shadowed($$PWD)
load(qt_build_config)
DEFINES += QT_NO_FOREACH
DEFINES += QT_NO_JAVA_STYLE_ITERATORS
MODULE_VERSION = 5.14.0

View File

@ -83,12 +83,12 @@ QVector<Qt3DCore::QNodeId> BufferManager::takeBuffersToRelease()
{
QMutexLocker lock(&m_mutex);
QVector<Qt3DCore::QNodeId> buffersToRelease;
QMutableHashIterator<Qt3DCore::QNodeId, int> it(m_bufferReferences);
while (it.hasNext()) {
it.next();
for (auto it = m_bufferReferences.begin(), end = m_bufferReferences.end(); it != end; /*erasing*/) {
if (it.value() == 0) {
buffersToRelease.append(it.key());
it.remove();
it = m_bufferReferences.erase(it);
} else {
++it;
}
}
return buffersToRelease;