mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-01 18:50:34 +03:00
fix(console): join the REPL task before esp_console_stop_repl frees it
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user