summaryrefslogtreecommitdiff
path: root/tests/auto
diff options
context:
space:
mode:
authorJędrzej Nowacki <jedrzej.nowacki@digia.com>2013-11-26 12:41:36 +0000
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-11-28 10:41:22 +0100
commit870a6e44740dea93c580ff171e909a89d0b71688 (patch)
treeab31084e7425da5e5cfacf42446dd2eb014f702e /tests/auto
parent2a9204258e01b5164a899ecc42ad6dcd67d6d423 (diff)
downloadqtenginio-870a6e44740dea93c580ff171e909a89d0b71688.tar.gz
Fix memory leak in tests.
QNetworkReply should be removed when finished. Change-Id: Ifb027d634885f4df26a5807c56b8e9f976b82d0b Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/common/common.cpp1
-rw-r--r--tests/auto/files/tst_files.cpp2
2 files changed, 3 insertions, 0 deletions
diff --git a/tests/auto/common/common.cpp b/tests/auto/common/common.cpp
index aae99e2..15968ca 100644
--- a/tests/auto/common/common.cpp
+++ b/tests/auto/common/common.cpp
@@ -165,6 +165,7 @@ bool EnginioBackendManager::authenticate()
QString sessionToken = _responseData[EnginioString::access_token].toString();
_headers[EnginioString::Authorization] = EnginioString::Bearer_ + sessionToken;
+ reply->deleteLater();
return !sessionToken.isEmpty();
}
diff --git a/tests/auto/files/tst_files.cpp b/tests/auto/files/tst_files.cpp
index eb87525..8ac1924 100644
--- a/tests/auto/files/tst_files.cpp
+++ b/tests/auto/files/tst_files.cpp
@@ -262,6 +262,7 @@ void tst_Files::fileUploadDownload()
QSignalSpy downloadSpy(reply, SIGNAL(finished()));
QTRY_COMPARE(downloadSpy.count(), 1);
QByteArray imageData = reply->readAll();
+ reply->deleteLater();
QImage img = QImage::fromData(imageData);
QCOMPARE(img.size(), QSize(181, 54));
}
@@ -328,6 +329,7 @@ void tst_Files::fileUploadDownload()
QSignalSpy downloadSpy(reply, SIGNAL(finished()));
QTRY_COMPARE(downloadSpy.count(), 1);
QByteArray imageData = reply->readAll();
+ reply->deleteLater();
QImage img = QImage::fromData(imageData);
QCOMPARE(img.size(), QSize(20, 20));
}