mirror of https://github.com/nymea/nymea.git
don't leak policies
parent
8df5d75dd1
commit
7b483bb087
|
|
@ -111,6 +111,11 @@ MqttClient *MqttProviderImplementation::createInternalClient(const DeviceId &dev
|
|||
client->setPassword(policy.password);
|
||||
client->setAutoReconnect(false);
|
||||
|
||||
connect(client, &MqttClient::destroyed, this, [this, clientId]() {
|
||||
qCDebug(dcMqtt) << "Internal MQTT client destroyed. Removing policy";
|
||||
m_broker->removePolicy(clientId);
|
||||
});
|
||||
|
||||
if (preferredConfig.address == QHostAddress::Any
|
||||
|| preferredConfig.address == QHostAddress::AnyIPv4
|
||||
|| preferredConfig.address == QHostAddress::LocalHost) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue