fix(console): Memory leaks after deinit

This commit is contained in:
Guillaume Souchere
2025-02-06 13:21:03 +01:00
parent 5b2f2e05f3
commit 203b3b5a4e
8 changed files with 62 additions and 6 deletions

View File

@@ -315,6 +315,8 @@ static esp_err_t esp_console_repl_uart_delete(esp_console_repl_t *repl)
vSemaphoreDelete(repl_com->state_mux);
repl_com->state_mux = NULL;
esp_console_common_deinit(&uart_repl->repl_com);
esp_console_deinit();
uart_vfs_dev_use_nonblocking(uart_repl->uart_channel);
uart_driver_delete(uart_repl->uart_channel);
@@ -356,6 +358,8 @@ static esp_err_t esp_console_repl_usb_cdc_delete(esp_console_repl_t *repl)
vSemaphoreDelete(repl_com->state_mux);
repl_com->state_mux = NULL;
esp_console_common_deinit(&cdc_repl->repl_com);
esp_console_deinit();
free(cdc_repl);
_exit:
@@ -395,6 +399,8 @@ static esp_err_t esp_console_repl_usb_serial_jtag_delete(esp_console_repl_t *rep
vSemaphoreDelete(repl_com->state_mux);
repl_com->state_mux = NULL;
esp_console_common_deinit(&usb_serial_jtag_repl->repl_com);
esp_console_deinit();
usb_serial_jtag_vfs_use_nonblocking();
usb_serial_jtag_driver_uninstall();