From 6a80b29fd3262e86cf84c41cd9bd628b1b1fd2dd Mon Sep 17 00:00:00 2001 From: hsaturn Date: Fri, 19 Mar 2021 22:30:58 +0100 Subject: [PATCH] [broker] fix timeout on external client --- src/TinyMqtt.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/TinyMqtt.cpp b/src/TinyMqtt.cpp index f9c6600..e2f7a2d 100644 --- a/src/TinyMqtt.cpp +++ b/src/TinyMqtt.cpp @@ -34,6 +34,7 @@ MqttClient::MqttClient(MqttBroker* parent) MqttClient::~MqttClient() { close(); + delete client; parent->removeClient(this); } @@ -42,8 +43,6 @@ void MqttClient::close() if (client) { client->stop(); - delete client; - client = nullptr; } }