1
0
mirror of https://github.com/d47081/qBittorrent.git synced 2025-01-10 14:57:52 +00:00

Fix potential use-after-move

The evaluation order for function parameters is unspecified in C++.
https://stackoverflow.com/questions/2934904/order-of-evaluation-in-c-function-parameters

Fix up 1b2ff0f6f8.
This commit is contained in:
Chocobo1 2023-07-01 13:37:50 +08:00
parent f4deb1050f
commit 3c139ca333
No known key found for this signature in database
GPG Key ID: 210D9C873253A68C

View File

@ -6091,7 +6091,8 @@ void SessionImpl::processTrackerStatuses()
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
updatedTrackerEntries[trackerEntry.url] = std::move(trackerEntry);
#else
updatedTrackerEntries.emplace(trackerEntry.url, std::move(trackerEntry));
const QString url = trackerEntry.url;
updatedTrackerEntries.emplace(url, std::move(trackerEntry));
#endif
}