Skip to content

Commit

Permalink
Moves state change when stopping the client
Browse files Browse the repository at this point in the history
- In some situations client could be left in a state where it's
  impossible to restart due to a state change while waiting for the
  stop. This guarantee that it's possible to start after calling stop.

Closes #239
  • Loading branch information
euripedesrocha committed Oct 26, 2022
1 parent 5f297c0 commit 3738fcd
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions mqtt_client.c
Expand Up @@ -1653,6 +1653,7 @@ static void esp_mqtt_task(void *pv)
esp_transport_close(client->transport);
outbox_delete_all_items(client->outbox);
xEventGroupSetBits(client->status_bits, STOPPED_BIT);
client->state = MQTT_STATE_DISCONNECTED;

vTaskDelete(NULL);
}
Expand Down

0 comments on commit 3738fcd

Please sign in to comment.