Skip to content

Commit 36eec6f

Browse files
Fix: Stop client only if it's running.
Check for client run instead of lock to call esp_mqtt_client_stop when destroying the client.
1 parent effd1e6 commit 36eec6f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mqtt_client.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -877,7 +877,7 @@ esp_err_t esp_mqtt_client_destroy(esp_mqtt_client_handle_t client)
877877
if (client == NULL) {
878878
return ESP_ERR_INVALID_ARG;
879879
}
880-
if (client->api_lock) {
880+
if (client->run) {
881881
esp_mqtt_client_stop(client);
882882
}
883883
esp_mqtt_destroy_config(client);

0 commit comments

Comments
 (0)