git-svn-id: http://ltt.polymtl.ca/svn@473 04897980-b3bd-0310-b5e0-8ef037075253
[lttv.git] / ltt / branches / poly / lttv / modules / gui / main / src / callbacks.c
index cc6ec38bf791c73086d2eec62e7a6fee1762a8fb..76cd18c208d98ad53479cdf36365ca42349e893e 100644 (file)
@@ -529,7 +529,8 @@ void remove_trace(GtkWidget * widget, gpointer user_data)
            g_object_unref(mw_data->current_tab->traceset_info->traceset_context);
          }
          lttv_traceset_remove(traceset, i);
-         lttv_trace_destroy(trace_v);
+         if(!lttv_trace_get_ref_number(trace_v))
+            lttv_trace_destroy(trace_v);
          mw_data->current_tab->traceset_info->traceset_context =
            g_object_new(LTTV_TRACESET_STATS_TYPE, NULL);
          lttv_context_init(
@@ -537,8 +538,16 @@ void remove_trace(GtkWidget * widget, gpointer user_data)
                                      traceset_info->traceset_context),traceset);      
          //update current tab
          update_traceset(mw_data);
-         redraw_viewer(mw_data, &(mw_data->current_tab->time_window));
-         set_current_time(mw_data,&(mw_data->current_tab->current_time));
+         if(nb_trace > 1){
+           redraw_viewer(mw_data, &(mw_data->current_tab->time_window));
+           set_current_time(mw_data,&(mw_data->current_tab->current_time));
+         }else{
+           if(mw_data->current_tab){
+             while(mw_data->current_tab->multi_vpaned->num_children){
+               gtk_multi_vpaned_widget_delete(mw_data->current_tab->multi_vpaned);
+             }    
+           }       
+         }
        }
        break;
       }
This page took 0.025936 seconds and 4 git commands to generate.