Skip to content

Commit

Permalink
Mqtt queued messages not freed when client destroyed (#1594)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikee47 authored and slaff committed Feb 5, 2019
1 parent 324e808 commit b344b6a
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions Sming/SmingCore/Network/MqttClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,9 @@ MqttClient::MqttClient(bool withDefaultPayloadParser /* = true */, bool autoDest

MqttClient::~MqttClient()
{
mqtt_message_t* message = nullptr;
do {
message = requestQueue.dequeue();
if(message) {
break;
}

mqtt_message_clear(message, 1);
} while(true);
while(requestQueue.count() != 0) {
mqtt_message_clear(requestQueue.dequeue(), 1);
}

mqtt_message_clear(&connectMessage, 0);
if(outgoingMessage) {
Expand Down

0 comments on commit b344b6a

Please sign in to comment.