diff options
author | Brett Stottlemyer <bstottle@ford.com> | 2018-12-15 07:42:46 -0500 |
---|---|---|
committer | Brett Stottlemyer <bstottle@ford.com> | 2018-12-19 00:17:33 +0000 |
commit | 76819c0316c03d1333d8e8c93bc7a3d8df4891ea (patch) | |
tree | 67a8293b5239eeaa28dc2eac123116f8bf302807 /src/remoteobjects/qconnection_qnx_backend.cpp | |
parent | 5bc5f04be23237f9d55b2134ae55bd93bed342a0 (diff) |
Convert QNX backend to use shared pointers
Having destruction tied to parent could lead to double delete issues.
Change-Id: Ia8787d96a1cbf9ddf6c06c50e8d59522bb10e420
Reviewed-by: Michael Brasser <michael.brasser@live.com>
Diffstat (limited to 'src/remoteobjects/qconnection_qnx_backend.cpp')
-rw-r--r-- | src/remoteobjects/qconnection_qnx_backend.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/remoteobjects/qconnection_qnx_backend.cpp b/src/remoteobjects/qconnection_qnx_backend.cpp index 5a393aa..d9bd9c5 100644 --- a/src/remoteobjects/qconnection_qnx_backend.cpp +++ b/src/remoteobjects/qconnection_qnx_backend.cpp @@ -118,17 +118,16 @@ void QnxClientIo::onStateChanged(QAbstractSocket::SocketState state) initializeDataStream(); } -QnxServerIo::QnxServerIo(QIOQnxSource *conn, QObject *parent) +QnxServerIo::QnxServerIo(QSharedPointer<QIOQnxSource> conn, QObject *parent) : ServerIoDevice(parent), m_connection(conn) { - m_connection->setParent(this); - connect(conn, &QIODevice::readyRead, this, &ServerIoDevice::readyRead); - connect(conn, &QIOQnxSource::disconnected, this, &ServerIoDevice::disconnected); + connect(conn.data(), &QIODevice::readyRead, this, &ServerIoDevice::readyRead); + connect(conn.data(), &QIOQnxSource::disconnected, this, &ServerIoDevice::disconnected); } QIODevice *QnxServerIo::connection() const { - return m_connection; + return m_connection.data(); } void QnxServerIo::doClose() |