cli_registry: move from bptree to dict, fix memory leak

This commit is contained in:
Anna Antonenko
2025-04-08 18:05:08 +04:00
parent 9a6aa17bee
commit 4140952605
4 changed files with 29 additions and 41 deletions

View File

@@ -111,10 +111,10 @@ void cli_shell_completions_fill_variants(CliShellCompletions* completions) {
if(segment.type == CliShellCompletionSegmentTypeCommand) {
CliRegistry* registry = completions->registry;
cli_registry_lock(registry);
CliCommandTree_t* commands = cli_registry_get_commands(registry);
CliCommandDict_t* commands = cli_registry_get_commands(registry);
for
M_EACH(registered_command, *commands, CliCommandTree_t) {
FuriString* command_name = *registered_command->key_ptr;
M_EACH(registered_command, *commands, CliCommandDict_t) {
FuriString* command_name = registered_command->key;
if(furi_string_start_with(command_name, input)) {
CommandCompletions_push_back(completions->variants, command_name);
}