fix(console): join the REPL task before esp_console_stop_repl frees it

This commit is contained in:
Yogesh Mantri
2026-09-10 10:12:00 +00:00
parent 2e6d41c2e9
commit cd1a5fc1f3
3 changed files with 22 additions and 0 deletions
@@ -92,6 +92,14 @@ esp_err_t esp_console_internal_set_event_fd(esp_console_repl_com_t *repl_com)
}
xSemaphoreGive(repl_com->state_mux);
repl_com->task_ready = xSemaphoreCreateBinary();
if (repl_com->task_ready == NULL) {
ESP_LOGE(TAG, "task_ready create error");
vSemaphoreDelete(repl_com->state_mux);
repl_com->state_mux = NULL;
return ESP_ERR_NO_MEM;
}
return ESP_OK;
}
@@ -123,6 +131,9 @@ esp_err_t esp_console_common_deinit(esp_console_repl_com_t *repl_com)
vSemaphoreDelete(repl_com->state_mux);
repl_com->state_mux = NULL;
vSemaphoreDelete(repl_com->task_ready);
repl_com->task_ready = NULL;
/* Unregister the heap function to avoid memory leak, since it is created
* every time a console init is called. */
esp_err_t ret = esp_console_deregister_help_command();