diff --git a/mqtt_client.c b/mqtt_client.c index fed7e7b..94c6158 100644 --- a/mqtt_client.c +++ b/mqtt_client.c @@ -1494,6 +1494,7 @@ esp_err_t esp_mqtt_client_stop(esp_mqtt_client_handle_t client) /* A running client cannot be stopped from the MQTT task/event handler */ TaskHandle_t running_task = xTaskGetCurrentTaskHandle(); if (running_task == client->task_handle) { + MQTT_API_UNLOCK(client); ESP_LOGE(TAG, "Client cannot be stopped from MQTT task"); return ESP_FAIL; }