QHttpHeaders: add a missing detach()
Before calling a mutable member function (in this case, QList::reserve()) on one of the Private members, we need to ensure exclusive ownership of our external state, otherwise we have a Data Race, because QList::reserve() is not thread-safe (only re-entrant). Change-Id: I1249de9449865cbf6ab519b0d38b3bf4e743f16d Reviewed-by: Juha Vuolle <juha.vuolle@qt.io> (cherry picked from commit 119a6b51869b7ffba4fa49bc07e78a243fe4a9ba) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
d7d9442368
commit
268d7b202a
@ -1040,6 +1040,7 @@ qsizetype QHttpHeaders::size() const noexcept
|
||||
*/
|
||||
void QHttpHeaders::reserve(qsizetype size)
|
||||
{
|
||||
d.detach();
|
||||
d->headers.reserve(size);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user