From 365c6e81be0f09cf92ec4ed5a62f9951517859e7 Mon Sep 17 00:00:00 2001 From: Oliver Wolff Date: Wed, 3 Sep 2014 09:20:16 +0200 Subject: [PATCH] WinRT: Fixed construction of QNativeSocketEngine without parent Change-Id: If55a8049224a7dceca33a3cf3089d541a3a97b8e Reviewed-by: Andrew Knight --- src/network/socket/qnativesocketengine_winrt.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/network/socket/qnativesocketengine_winrt.cpp b/src/network/socket/qnativesocketengine_winrt.cpp index 2ea6d6e015..62b067750c 100644 --- a/src/network/socket/qnativesocketengine_winrt.cpp +++ b/src/network/socket/qnativesocketengine_winrt.cpp @@ -176,10 +176,8 @@ QNativeSocketEngine::QNativeSocketEngine(QObject *parent) { #ifndef QT_NO_SSL Q_D(QNativeSocketEngine); - Q_ASSERT(parent); - d->sslSocket = qobject_cast(parent->parent()); -#else - d->sslSocket = Q_NULLPTR; + if (parent) + d->sslSocket = qobject_cast(parent->parent()); #endif connect(this, SIGNAL(connectionReady()), SLOT(connectionNotification()), Qt::QueuedConnection); @@ -827,6 +825,7 @@ QNativeSocketEnginePrivate::QNativeSocketEnginePrivate() , notifyOnException(false) , closingDown(false) , socketDescriptor(-1) + , sslSocket(Q_NULLPTR) { }