diff options
author | Paul Lemire <paul.lemire@kdab.com> | 2021-02-19 07:29:47 +0100 |
---|---|---|
committer | Paul Lemire <paul.lemire@kdab.com> | 2021-02-24 15:45:26 +0100 |
commit | c4194c5a37b2879fd5802f00d45c46f31278b0b3 (patch) | |
tree | 798aba9727bffccf7a17eb012905268cae706343 /src/animation | |
parent | e7c53539ae743d49df7eab800e4b17f449f4f0e8 (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/animation')
-rw-r--r-- | src/animation/backend/handler.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/animation/backend/handler.cpp b/src/animation/backend/handler.cpp index d74138d91..989f6b958 100644 --- a/src/animation/backend/handler.cpp +++ b/src/animation/backend/handler.cpp @@ -45,6 +45,7 @@ #include <Qt3DAnimation/private/buildblendtreesjob_p.h> #include <Qt3DAnimation/private/evaluateblendclipanimatorjob_p.h> #include <Qt3DCore/private/qaspectjob_p.h> +#include <Qt3DCore/private/vector_helper_p.h> QT_BEGIN_NAMESPACE @@ -218,7 +219,7 @@ std::vector<Qt3DCore::QAspectJobPtr> Handler::jobsToExecute(qint64 time) // Rebuild blending trees if a blend tree is dirty const bool hasBuildBlendTreesJob = !m_dirtyBlendedAnimators.isEmpty(); if (hasBuildBlendTreesJob) { - const QVector<HBlendedClipAnimator> dirtyBlendedAnimators = std::move(m_dirtyBlendedAnimators); + const QVector<HBlendedClipAnimator> dirtyBlendedAnimators = Qt3DCore::moveAndClear(m_dirtyBlendedAnimators); m_buildBlendTreesJob->setBlendedClipAnimators(dirtyBlendedAnimators); jobs.push_back(m_buildBlendTreesJob); } |