aboutsummaryrefslogtreecommitdiff
path: root/quotest/quotest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'quotest/quotest.cpp')
-rw-r--r--quotest/quotest.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/quotest/quotest.cpp b/quotest/quotest.cpp
index 31a0b6d6..4142c718 100644
--- a/quotest/quotest.cpp
+++ b/quotest/quotest.cpp
@@ -445,11 +445,14 @@ struct DownloadRunner {
using result_type = QNetworkReply::NetworkError;
- QNetworkReply::NetworkError operator()(int) const {
+ QNetworkReply::NetworkError operator()(int) const
+ {
QEventLoop el;
- auto reply = NetworkAccessManager::instance()->get(QNetworkRequest(url));
+ QScopedPointer<QNetworkReply, QScopedPointerDeleteLater> reply {
+ NetworkAccessManager::instance()->get(QNetworkRequest(url))
+ };
QObject::connect(
- reply, &QNetworkReply::finished, &el, [&el] { el.exit(); },
+ reply.data(), &QNetworkReply::finished, &el, [&el] { el.exit(); },
Qt::QueuedConnection);
el.exec();
return reply->error();