QNetworkAccessBackend: Do not leak wrapped upload byte device

The wrappedUploadByteDevice is obviously intended to be owned by
QNetworkAccessBackend. It needs to be deleted when QNetworkAccessBackend
is destroyed.

Ideally we shouldn't use bare pointers at all here, but since we need
to pick this back all the way to 6.5, a minimal fix is preferred.

Amends commit bba0bdb35c2806bcdde8e89965e99b3d412b8d3a

Change-Id: Icbe857ad02c23693c313d3fcb2d0ee068362e5b7
Pick-to: 6.8 6.5
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 9a7d06f0d4551ef393eab6da21ad162582dccda6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit ce0e4ca6fe5ec21275c3884216800521fc6280f5)
This commit is contained in:
Ulf Hermann 2025-06-11 09:53:52 +02:00 committed by Qt Cherry-pick Bot
parent 89d88a23a9
commit 5f69c44d75

View File

@ -258,7 +258,10 @@ QNetworkAccessBackend::QNetworkAccessBackend(TargetTypes targetTypes, IOFeatures
/*!
Destructs the QNetworkAccessBackend base class.
*/
QNetworkAccessBackend::~QNetworkAccessBackend() { }
QNetworkAccessBackend::~QNetworkAccessBackend()
{
delete d_func()->wrappedUploadByteDevice;
}
/*!
Returns the security related features that the backend claims to