Skip to content

Commit 44292cc

Browse files
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.
1 parent 9de024c commit 44292cc

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
@@ -1763,8 +1763,8 @@ static void esp_mqtt_task(void *pv)
17631763
}
17641764
esp_transport_close(client->transport);
17651765
outbox_delete_all_items(client->outbox);
1766-
xEventGroupSetBits(client->status_bits, STOPPED_BIT);
17671766
client->state = MQTT_STATE_DISCONNECTED;
1767+
xEventGroupSetBits(client->status_bits, STOPPED_BIT);
17681768

17691769
vTaskDelete(NULL);
17701770
}

0 commit comments

Comments
 (0)