summaryrefslogtreecommitdiffstats
path: root/src/network/ssl/qtlsbackend.cpp
diff options
context:
space:
mode:
authorTimur Pocheptsov <timur.pocheptsov@qt.io>2022-01-20 10:52:17 +0100
committerTimur Pocheptsov <timur.pocheptsov@qt.io>2022-01-20 19:01:27 +0100
commit9ac323f7cd4b34b7dff25d64251b4cd8c5ef60a4 (patch)
tree479e80d577460e7ab1c284af6f8c723e27a7d1e2 /src/network/ssl/qtlsbackend.cpp
parent4dc977d5ee6aabcda4a8cf6b3ea940c38ff5928a (diff)
QTlsBackend/QSslSocket - check the arguments we pass to QObject::connect
Not to have warnings about invalid (nullptr) parameters. Change-Id: I5fdfa7e99df0f3c9907055cf244efa5a56b21c11 Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'src/network/ssl/qtlsbackend.cpp')
-rw-r--r--src/network/ssl/qtlsbackend.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/network/ssl/qtlsbackend.cpp b/src/network/ssl/qtlsbackend.cpp
index a510e95f92a..dbfbddc3793 100644
--- a/src/network/ssl/qtlsbackend.cpp
+++ b/src/network/ssl/qtlsbackend.cpp
@@ -203,9 +203,11 @@ QTlsBackend::QTlsBackend()
if (backends())
backends->addBackend(this);
- connect(QCoreApplication::instance(), &QCoreApplication::destroyed, this, [this] {
- delete this;
- });
+ if (QCoreApplication::instance()) {
+ connect(QCoreApplication::instance(), &QCoreApplication::destroyed, this, [this] {
+ delete this;
+ });
+ }
}
/*!