Skip to content
This repository was archived by the owner on Mar 28, 2026. It is now read-only.

Commit 1b7eb5c

Browse files
committed
Fix crash caused by connection attempt timeout
Introduced in f7452af
1 parent 7c41b87 commit 1b7eb5c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/system/SystemComponent.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include <QSslError>
1818
#include <QDebug>
1919
#include <QRegularExpression>
20+
#include <QPointer>
2021
#include <functional>
2122

2223
#include "input/InputComponent.h"
@@ -271,9 +272,10 @@ QSslConfiguration SystemComponent::getSSLConfiguration()
271272
///////////////////////////////////////////////////////////////////////////////////////////////////
272273
void SystemComponent::setReplyTimeout(QNetworkReply* reply, int ms)
273274
{
274-
QTimer::singleShot(ms, this, [reply]() {
275-
if (!reply->isFinished()) {
276-
reply->abort();
275+
QPointer<QNetworkReply> replyPtr(reply);
276+
QTimer::singleShot(ms, this, [replyPtr]() {
277+
if (replyPtr && !replyPtr->isFinished()) {
278+
replyPtr->abort();
277279
}
278280
});
279281
}

0 commit comments

Comments
 (0)