diff options
author | Lionel Fafchamps <lionel@fafchamps.com> | 2022-11-22 18:59:04 +0000 |
---|---|---|
committer | Brett Stottlemyer <bstottle@ford.com> | 2022-12-12 10:10:15 +0000 |
commit | d4414cb7baa8a0049a51d5ef4a485cf6ae5d65db (patch) | |
tree | d55215dda78756d7a93f649126c7bf9da24a1c87 /src/remoteobjects/qconnectionfactories.cpp | |
parent | 0d46612844917097d63df2dc1479797d979d8ffe (diff) |
Fix missing QIODevice disconnect() signal connection
The QtROExternalIoDevice fails to register a disconnect()
signal from the underlying QIODevice. If the server tries
to initiate communication after the client disconnects,
it will segfault trying to access the QIODevice.
There is a metaObject check for the disconnect() signal before
connecting, as disconnect() isn't part of the QIODevice
interface. However, metaObject::indexOfSignal is being passed
a SIGNAL(disconnect()), which is not the correct format. It
should be passed the normalized signature "disconnect()"
Pick-to: 5.15 6.2 6.4
Change-Id: I6cc6d51faff49d4106f4126352e1e9e6cf6165a2
Reviewed-by: Brett Stottlemyer <bstottle@ford.com>
Diffstat (limited to 'src/remoteobjects/qconnectionfactories.cpp')
-rw-r--r-- | src/remoteobjects/qconnectionfactories.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/remoteobjects/qconnectionfactories.cpp b/src/remoteobjects/qconnectionfactories.cpp index 22a7a83..38ab07f 100644 --- a/src/remoteobjects/qconnectionfactories.cpp +++ b/src/remoteobjects/qconnectionfactories.cpp @@ -223,7 +223,7 @@ QtROExternalIoDevice::QtROExternalIoDevice(QIODevice *device, QObject *parent) connect(device, &QIODevice::aboutToClose, this, [d]() { d->m_isClosing = true; }); connect(device, &QIODevice::readyRead, this, &QtROExternalIoDevice::readyRead); auto meta = device->metaObject(); - if (-1 != meta->indexOfSignal(SIGNAL(disconnected()))) + if (-1 != meta->indexOfSignal("disconnected()")) connect(device, SIGNAL(disconnected()), this, SIGNAL(disconnected())); } |