mirror of
https://github.com/espressif/esp-mqtt.git
synced 2025-07-29 18:28:24 +02:00
fix: Race condition when using destroy
In a case were destroy is being called by a higher priority task set the STOPPED_BIT before seting the state would lead to a crash.
This commit is contained in:
@ -1763,8 +1763,8 @@ 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;
|
||||
xEventGroupSetBits(client->status_bits, STOPPED_BIT);
|
||||
|
||||
vTaskDelete(NULL);
|
||||
}
|
||||
|
Reference in New Issue
Block a user