From: Julien Desfossez Date: Tue, 24 Apr 2012 20:10:44 +0000 (-0400) Subject: Allow to remove a selected process for the highlights X-Git-Tag: v0.2~11 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=84c36c18637e2b02dd9a91646065f90e02eca660;p=lttngtop.git Allow to remove a selected process for the highlights Signed-off-by: Julien Desfossez --- diff --git a/src/cursesdisplay.c b/src/cursesdisplay.c index b63fa9b..49ec23c 100644 --- a/src/cursesdisplay.c +++ b/src/cursesdisplay.c @@ -237,11 +237,21 @@ int process_selected(struct processtop *process) void update_selected_processes() { + int i; + struct processtop *stored_process; + if (process_selected(selected_process)) { - g_ptr_array_remove(selected_processes, selected_process); - print_log("Process removed"); + for (i = 0; i < selected_processes->len; i++) { + stored_process = g_ptr_array_index(selected_processes, i); + if (!stored_process) + return; + if (stored_process->tid == selected_process->tid) + g_ptr_array_remove(selected_processes, + stored_process); + print_log("Process removed"); + } } else { - g_ptr_array_add(selected_processes, selected_process); + g_ptr_array_add(selected_processes, selected_process); print_log("Process added"); } }