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.

Pick-to: 6.6 6.5 6.2 5.15
Change-Id: I1b27663df9ad49e0203172265d224fdb6ec06646
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
This commit is contained in:
Marc Mutz 2023-07-14 21:14:39 +02:00
parent 90226018a9
commit bad3b8f78b

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);
}
}