Skip to content

Commit

Permalink
Merge branch 'fix/stop_only_if_started' into 'master'
Browse files Browse the repository at this point in the history
Fix: Stop client only if it's running.

See merge request espressif/esp-mqtt!183
  • Loading branch information
euripedesrocha committed Jul 10, 2023
2 parents 8d98103 + 36eec6f commit 395aa14
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mqtt_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -877,7 +877,7 @@ esp_err_t esp_mqtt_client_destroy(esp_mqtt_client_handle_t client)
if (client == NULL) {
return ESP_ERR_INVALID_ARG;
}
if (client->api_lock) {
if (client->run) {
esp_mqtt_client_stop(client);
}
esp_mqtt_destroy_config(client);
Expand Down

0 comments on commit 395aa14

Please sign in to comment.