When setFuture() was handed an element of m_futures, it would hold the reference to past the clear(), which invalidates said reference. Fix by taking the future by value instead of by cref. While append() is not affected, as QList::append() already guards against aliasing, do the same change there, both for consistency as well as to optimize the common case of passing rvalues. It also means we can use the rvalue overload of QList::append(), skipping the alias analysis in the lvalue QList::append(). [ChangeLog][QtConcurrent][QFutureSynchronizer] Fixed a crash in setFuture() if the argument was already a member of QFutureSynchronizer::futures(). Change-Id: Ic0b212b9f265a746df9a6beb6272a5415d131442 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> (cherry picked from commit e8dcbaaaf61ee2164db61e70a5d61d7a5b849371) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
…
Description
Languages
C++
84.3%
HTML
4.9%
C
3.9%
CMake
3.6%
Objective-C++
2%
Other
0.8%