diff options
author | Liang Qi <liang.qi@qt.io> | 2017-12-05 13:32:35 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2017-12-05 13:37:21 +0100 |
commit | 53b141dcebc2ca423dbc31e5b6321a769155e9a4 (patch) | |
tree | e62c7d9875acab8094d64d137c90e7e5f53c0893 /src/corelib/tools/qvector.h | |
parent | 2c6c044500a92a3a125ce4b5d936992bdf02a487 (diff) | |
parent | 6508fdca1dcc7105947befadba272d0fd4bbc27f (diff) |
Merge remote-tracking branch 'origin/5.9' into 5.10
Conflicts:
src/plugins/platforms/ios/quiview.mm
Change-Id: I88384c70047391c75d9ff166c8d9881ff6751dbf
Diffstat (limited to 'src/corelib/tools/qvector.h')
-rw-r--r-- | src/corelib/tools/qvector.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/corelib/tools/qvector.h b/src/corelib/tools/qvector.h index 4daf894887..3a3d416775 100644 --- a/src/corelib/tools/qvector.h +++ b/src/corelib/tools/qvector.h @@ -164,9 +164,10 @@ public: const const_iterator ce = this->cend(), cit = std::find(this->cbegin(), ce, t); if (cit == ce) return 0; - // next operation detaches, so ce, cit may become invalidated: + // next operation detaches, so ce, cit, t may become invalidated: + const T tCopy = t; const int firstFoundIdx = std::distance(this->cbegin(), cit); - const iterator e = end(), it = std::remove(begin() + firstFoundIdx, e, t); + const iterator e = end(), it = std::remove(begin() + firstFoundIdx, e, tCopy); const int result = std::distance(it, e); erase(it, e); return result; |