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). Pick-to: 6.7 Change-Id: I1249de9449865cbf6ab519b0d38b3bf4e743f16d Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
This commit is contained in:
parent
55ee5481bc
commit
119a6b5186
@ -1040,6 +1040,7 @@ qsizetype QHttpHeaders::size() const noexcept
|
|||||||
*/
|
*/
|
||||||
void QHttpHeaders::reserve(qsizetype size)
|
void QHttpHeaders::reserve(qsizetype size)
|
||||||
{
|
{
|
||||||
|
d.detach();
|
||||||
d->headers.reserve(size);
|
d->headers.reserve(size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user