diff options
-rw-r--r-- | .qmake.conf | 2 | ||||
-rw-r--r-- | src/remoteobjects/qconnection_tcpip_backend.cpp | 17 | ||||
-rw-r--r-- | src/remoteobjects/qremoteobjectreplica.cpp | 6 |
3 files changed, 14 insertions, 11 deletions
diff --git a/.qmake.conf b/.qmake.conf index 9732a12..783d358 100644 --- a/.qmake.conf +++ b/.qmake.conf @@ -4,6 +4,6 @@ CONFIG += qt_example_installs DEFINES += QT_NO_JAVA_STYLE_ITERATORS DEFINES += QT_NO_FOREACH -MODULE_VERSION = 5.15.16 +MODULE_VERSION = 5.15.17 QTRO_SOURCE_TREE = $$PWD diff --git a/src/remoteobjects/qconnection_tcpip_backend.cpp b/src/remoteobjects/qconnection_tcpip_backend.cpp index 42b3d85..f99ee9e 100644 --- a/src/remoteobjects/qconnection_tcpip_backend.cpp +++ b/src/remoteobjects/qconnection_tcpip_backend.cpp @@ -81,14 +81,15 @@ void TcpClientIo::connectToServer() { if (isOpen()) return; - QHostAddress address(url().host()); - if (address.isNull()) { - const QList<QHostAddress> addresses = QHostInfo::fromName(url().host()).addresses(); - Q_ASSERT_X(addresses.size() >= 1, Q_FUNC_INFO, url().toString().toLatin1().data()); - address = addresses.first(); - } - - m_socket->connectToHost(address, url().port()); + const QString &host = url().host(); + QHostAddress address(host); + if (address.isNull()) + address = QHostInfo::fromName(host).addresses().value(0); + + if (address.isNull()) + qWarning("connectToServer(): Failed to resolve host %s", qUtf8Printable(host)); + else + m_socket->connectToHost(address, url().port()); } bool TcpClientIo::isOpen() const diff --git a/src/remoteobjects/qremoteobjectreplica.cpp b/src/remoteobjects/qremoteobjectreplica.cpp index ddfe3ec..4eae1e9 100644 --- a/src/remoteobjects/qremoteobjectreplica.cpp +++ b/src/remoteobjects/qremoteobjectreplica.cpp @@ -146,8 +146,10 @@ QConnectedReplicaImplementation::~QConnectedReplicaImplementation() sendCommand(); } for (auto prop : m_propertyStorage) { - if (prop.canConvert<QObject*>()) - prop.value<QObject *>()->deleteLater(); + if (prop.canConvert<QObject*>()) { + if (auto o = prop.value<QObject*>()) + o->deleteLater(); + } } } |