mirror of
https://github.com/espressif/esp-idf.git
synced 2026-09-22 13:01:16 +03:00
fix(blufi): Fix BLUFI NimBLE deinit race due to disconnect callbacks
This commit is contained in:
@@ -316,6 +316,11 @@ static void btc_thread_handler(void *arg)
|
||||
|
||||
static bt_status_t btc_task_post(btc_msg_t *msg, uint32_t timeout)
|
||||
{
|
||||
if (btc_thread == NULL) {
|
||||
BTC_TRACE_WARNING("%s btc_thread is NULL\n", __func__);
|
||||
return BT_STATUS_NOT_READY;
|
||||
}
|
||||
|
||||
if (osi_thread_post(btc_thread, btc_thread_handler, msg, 0, timeout) == false) {
|
||||
return BT_STATUS_BUSY;
|
||||
}
|
||||
|
||||
@@ -502,6 +502,10 @@ esp_blufi_gap_event(struct ble_gap_event *event, void *arg)
|
||||
blufi_env.aggr_buf = NULL;
|
||||
}
|
||||
|
||||
if (!blufi_env.enabled) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
btc_msg_t msg;
|
||||
esp_blufi_cb_param_t param;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user