tst_QNetworkDiskCache: fix mem-leak

A caller of Q(Abstract)NetworkDiskCache::data() is supposed to delete
the returned value, and this caller forgot.

Do it now; better late than never.

Amends feb1afc782.

Change-Id: I1b27663df9ad49e0203172265d224fdb6ec06646
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit bad3b8f78b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Marc Mutz 2023-07-14 21:14:39 +02:00 committed by Qt Cherry-pick Bot
parent 09cebbd128
commit 360e71d5be

View File

@ -657,6 +657,7 @@ void tst_QNetworkDiskCache::streamVersion()
QIODevice *dataDevice = cache.data(url);
QVERIFY(dataDevice != 0);
QByteArray cachedData = dataDevice->readAll();
delete dataDevice;
QCOMPARE(cachedData, data);
}
}