summaryrefslogtreecommitdiffstats
path: root/src/core/aspects
diff options
context:
space:
mode:
authorPaul Lemire <paul.lemire@kdab.com>2021-02-19 07:29:47 +0100
committerPaul Lemire <paul.lemire@kdab.com>2021-02-24 15:45:26 +0100
commitc4194c5a37b2879fd5802f00d45c46f31278b0b3 (patch)
tree798aba9727bffccf7a17eb012905268cae706343 /src/core/aspects
parente7c53539ae743d49df7eab800e4b17f449f4f0e8 (diff)
Replace all implicit container move and clear by an explicit function
We are likely relying on the fact that most implementations of containers clear the moved from container when calling std::move. That being said this behavior is likely implementation/platform dependent and could bite us at some later point. This patch introduces a moveAndClear function that does the move and an explicit clear and use it in all appropriate places. Change-Id: I8081d09907e17e287741fa952269af22df4dcf5f Reviewed-by: Mike Krus <mike.krus@kdab.com>
Diffstat (limited to 'src/core/aspects')
-rw-r--r--src/core/aspects/qaspectmanager.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/core/aspects/qaspectmanager.cpp b/src/core/aspects/qaspectmanager.cpp
index 3931fb311..28f689c3c 100644
--- a/src/core/aspects/qaspectmanager.cpp
+++ b/src/core/aspects/qaspectmanager.cpp
@@ -65,6 +65,7 @@
#include <Qt3DCore/private/qnodevisitor_p.h>
#include <Qt3DCore/private/qnode_p.h>
#include <Qt3DCore/private/qscene_p.h>
+#include <Qt3DCore/private/vector_helper_p.h>
#include <QtCore/QCoreApplication>
#if QT_CONFIG(animation)
@@ -528,7 +529,7 @@ void QAspectManager::processFrame()
m_postConstructorInit->processNodes();
// Add and Remove Nodes
- const QList<NodeTreeChange> nodeTreeChanges = std::move(m_nodeTreeChanges);
+ const QList<NodeTreeChange> nodeTreeChanges = Qt3DCore::moveAndClear(m_nodeTreeChanges);
for (const NodeTreeChange &change : nodeTreeChanges) {
// Buckets ensure that even if we have intermingled node added / removed
// buckets, we preserve the order of the sequences