+ LttTrace *trace;
+ LttvTrace * trace_v;
+ LttvTraceset * traceset;
+ gint i, nb_trace;
+ char ** name, *remove_trace_name;
+ MainWindow * mw_data = get_window_data_struct(widget);
+
+ nb_trace =lttv_traceset_number(mw_data->traceset_info->traceset);
+ name = g_new(char*,nb_trace);
+ for(i = 0; i < nb_trace; i++){
+ trace_v = lttv_traceset_get(mw_data->traceset_info->traceset, i);
+ trace = lttv_trace(trace_v);
+ name[i] = trace->pathname;
+ }
+
+ remove_trace_name = get_remove_trace(name, nb_trace);
+
+ if(remove_trace_name){
+ for(i=0; i<nb_trace; i++){
+ if(strcmp(remove_trace_name,name[i]) == 0){
+ traceset = mw_data->traceset_info->traceset;
+ if(mw_data->traceset_info->traceset_context != NULL){
+ lttv_context_fini(LTTV_TRACESET_CONTEXT(mw_data->traceset_info->traceset_context));
+ g_object_unref(mw_data->traceset_info->traceset_context);
+ }
+ lttv_traceset_remove(traceset, i);
+ mw_data->traceset_info->traceset_context =
+ g_object_new(LTTV_TRACESET_STATS_TYPE, NULL);
+ lttv_context_init(
+ LTTV_TRACESET_CONTEXT(mw_data->traceset_info->traceset_context),traceset);
+ break;
+ }
+ }
+ }
+
+ g_free(name);