Merge PR #252: Fix crash when removing a connected transport interface

pull/263/head
Jenkins nymea 2020-01-29 21:44:34 +01:00
commit 401a42a78c
1 changed files with 4 additions and 0 deletions

View File

@ -458,6 +458,10 @@ void JsonRPCServerImplementation::unregisterTransportInterface(TransportInterfac
disconnect(interface, &TransportInterface::clientConnected, this, &JsonRPCServerImplementation::clientConnected);
disconnect(interface, &TransportInterface::clientDisconnected, this, &JsonRPCServerImplementation::clientDisconnected);
disconnect(interface, &TransportInterface::dataAvailable, this, &JsonRPCServerImplementation::processData);
foreach (const QUuid &clientId, m_clientTransports.keys(interface)) {
interface->terminateClientConnection(clientId);
clientDisconnected(clientId);
}
m_interfaces.take(interface);
}