Merge branch 'fix/stop_only_if_started' into 'master'

Fix: Stop client only if it's running.

See merge request espressif/esp-mqtt!183
This commit is contained in:
Rocha Euripedes
2023-07-10 15:55:33 +08:00

View File

@@ -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);