From 716e4367df9c21316d326ee18b703cd0d25ace74 Mon Sep 17 00:00:00 2001 From: yangxx Date: Mon, 3 Nov 2003 20:13:15 +0000 Subject: [PATCH] traceset per tab git-svn-id: http://ltt.polymtl.ca/svn@331 04897980-b3bd-0310-b5e0-8ef037075253 --- ltt/branches/poly/include/lttv/mainWindow.h | 21 +- .../poly/lttv/modules/gui/API/gtkTraceSet.c | 24 ++- .../lttv/modules/gui/mainWin/src/callbacks.c | 187 ++++++++---------- .../lttv/modules/gui/mainWin/src/callbacks.h | 3 +- .../lttv/modules/gui/mainWin/src/gtkcustom.c | 3 +- .../modules/gui/mainWin/src/init_module.c | 39 +--- 6 files changed, 110 insertions(+), 167 deletions(-) diff --git a/ltt/branches/poly/include/lttv/mainWindow.h b/ltt/branches/poly/include/lttv/mainWindow.h index 24c80da0..c590ac96 100644 --- a/ltt/branches/poly/include/lttv/mainWindow.h +++ b/ltt/branches/poly/include/lttv/mainWindow.h @@ -20,19 +20,9 @@ typedef struct _WindowCreationData { typedef struct _TracesetInfo { - gchar* path; - LttvHooks - *before_traceset, - *after_traceset, - *before_trace, - *after_trace, - *before_tracefile, - *after_tracefile, - *before_event, - *after_event; - //FIXME? TracesetContext and stats in same or different variable ? - LttvTracesetStats * traceset_context; - LttvTraceset * traceset; + //FIXME? TracesetContext and stats in same or different variable ? + LttvTracesetStats * traceset_context; + LttvTraceset * traceset; } TracesetInfo ; @@ -54,8 +44,6 @@ struct _MainWindow{ // lttv_trace_filter * filter; /* trace filter associated with the window */ - /* Traceset related information */ - TracesetInfo * traceset_info; /* Attributes for trace reading hooks local to the main window */ LttvIAttribute * attributes; @@ -85,6 +73,9 @@ struct _Tab{ struct _Tab * next; MainWindow * mw; + + /* Traceset related information */ + TracesetInfo * traceset_info; }; /** diff --git a/ltt/branches/poly/lttv/modules/gui/API/gtkTraceSet.c b/ltt/branches/poly/lttv/modules/gui/API/gtkTraceSet.c index 4eb1d3e6..22de5b16 100644 --- a/ltt/branches/poly/lttv/modules/gui/API/gtkTraceSet.c +++ b/ltt/branches/poly/lttv/modules/gui/API/gtkTraceSet.c @@ -211,7 +211,8 @@ void get_traceset_time_span(MainWindow *main_win, TimeInterval *time_interval) { //time_window->start_time = main_win->current_tab->time_window.start_time; //time_window->time_width = main_win->current_tab->time_window.time_width; - *time_interval = *(LTTV_TRACESET_CONTEXT(main_win->traceset_info->traceset_context)->Time_Span); + *time_interval = *(LTTV_TRACESET_CONTEXT(main_win->current_tab->traceset_info-> + traceset_context)->Time_Span); } @@ -579,8 +580,10 @@ void set_hpane_dividor(MainWindow *main_win, gint position) void process_traceset_api(MainWindow *main_win, LttTime start, LttTime end, unsigned maxNumEvents) { - lttv_process_traceset_seek_time(main_win->traceset_info->traceset_context, start); - lttv_process_traceset(main_win->traceset_info->traceset_context, end, maxNumEvents); + lttv_process_traceset_seek_time(main_win->current_tab->traceset_info-> + traceset_context, start); + lttv_process_traceset(main_win->current_tab->traceset_info-> + traceset_context, end, maxNumEvents); } /** @@ -605,7 +608,8 @@ void context_add_hooks_api(MainWindow *main_win , LttvHooks *after_event) { LttvTracesetContext * tsc = - LTTV_TRACESET_CONTEXT(main_win->traceset_info->traceset_context); + LTTV_TRACESET_CONTEXT(main_win->current_tab->traceset_info-> + traceset_context); lttv_traceset_context_add_hooks(tsc,before_traceset,after_traceset, check_trace,before_trace,after_trace, check_tracefile,before_tracefile,after_tracefile, @@ -635,7 +639,7 @@ void context_remove_hooks_api(MainWindow *main_win , LttvHooks *after_event) { LttvTracesetContext * tsc = - LTTV_TRACESET_CONTEXT(main_win->traceset_info->traceset_context); + LTTV_TRACESET_CONTEXT(main_win->current_tab->traceset_info->traceset_context); lttv_traceset_context_remove_hooks(tsc,before_traceset,after_traceset, check_trace,before_trace,after_trace, check_tracefile,before_tracefile,after_tracefile, @@ -651,13 +655,13 @@ void context_remove_hooks_api(MainWindow *main_win , void state_add_event_hooks_api(MainWindow *main_win ) { lttv_state_add_event_hooks( - (LttvTracesetState*)main_win->traceset_info->traceset_context); + (LttvTracesetState*)main_win->current_tab->traceset_info->traceset_context); } void state_remove_event_hooks_api(MainWindow *main_win ) { lttv_state_remove_event_hooks( - (LttvTracesetState*)main_win->traceset_info->traceset_context); + (LttvTracesetState*)main_win->current_tab->traceset_info->traceset_context); } @@ -669,13 +673,13 @@ void state_remove_event_hooks_api(MainWindow *main_win ) void stats_add_event_hooks_api(MainWindow *main_win ) { lttv_stats_add_event_hooks( - (LttvTracesetStats*)main_win->traceset_info->traceset_context); + (LttvTracesetStats*)main_win->current_tab->traceset_info->traceset_context); } void stats_remove_event_hooks_api(MainWindow *main_win ) { lttv_stats_remove_event_hooks( - (LttvTracesetStats*)main_win->traceset_info->traceset_context); + (LttvTracesetStats*)main_win->current_tab->traceset_info->traceset_context); } /** @@ -685,5 +689,5 @@ void stats_remove_event_hooks_api(MainWindow *main_win ) LttvTracesetStats* get_traceset_stats_api(MainWindow *main_win) { - return main_win->traceset_info->traceset_context; + return main_win->current_tab->traceset_info->traceset_context; } diff --git a/ltt/branches/poly/lttv/modules/gui/mainWin/src/callbacks.c b/ltt/branches/poly/lttv/modules/gui/mainWin/src/callbacks.c index c9b152c5..12ead7a5 100644 --- a/ltt/branches/poly/lttv/modules/gui/mainWin/src/callbacks.c +++ b/ltt/branches/poly/lttv/modules/gui/mainWin/src/callbacks.c @@ -31,7 +31,8 @@ MainWindow * get_window_data_struct(GtkWidget * widget); char * get_unload_module(char ** loaded_module_name, int nb_module); char * get_remove_trace(char ** all_trace_name, int nb_trace); char * get_selection(char ** all_name, int nb, char *title, char * column_title); -void * create_tab(GtkWidget* parent, GtkNotebook * notebook, char * label); +void * create_tab(MainWindow * parent, MainWindow * current_window, + GtkNotebook * notebook, char * label); void insert_viewer(GtkWidget* widget, view_constructor constructor); @@ -49,7 +50,6 @@ insert_viewer_wrap(GtkWidget *menuitem, gpointer user_data) GdkCursor * new; guint val = 20; GtkWidget* widget = menuitem; - MainWindow * mw; new = gdk_cursor_new(GDK_X_CURSOR); if(GTK_IS_MENU_ITEM(menuitem)){ @@ -95,7 +95,7 @@ void get_label_string (GtkWidget * text, gchar * label) strcpy(label,gtk_entry_get_text(entry)); } -void get_label(GtkWindow * mw, gchar * str, gchar* dialogue_title, gchar * label_str) +void get_label(MainWindow * mw, gchar * str, gchar* dialogue_title, gchar * label_str) { GtkWidget * dialogue; GtkWidget * text; @@ -155,10 +155,10 @@ void create_new_window(GtkWidget* widget, gpointer user_data, gboolean clone) if(clone){ g_printf("Clone : use the same traceset\n"); - construct_main_window(parent, NULL, FALSE); + construct_main_window(parent, NULL); }else{ g_printf("Empty : traceset is set to NULL\n"); - construct_main_window(NULL, parent->win_creation_data, FALSE); + construct_main_window(NULL, parent->win_creation_data); } } @@ -231,23 +231,24 @@ void add_trace(GtkWidget * widget, gpointer user_data) trace = ltt_trace_open(dir); if(trace == NULL) g_critical("cannot open trace %s", dir); trace_v = lttv_trace_new(trace); - 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); + traceset = mw_data->current_tab->traceset_info->traceset; + if(mw_data->current_tab->traceset_info->traceset_context != NULL){ + lttv_context_fini(LTTV_TRACESET_CONTEXT(mw_data->current_tab-> + traceset_info->traceset_context)); + g_object_unref(mw_data->current_tab->traceset_info->traceset_context); } lttv_traceset_add(traceset, trace_v); - mw_data->traceset_info->traceset_context = + mw_data->current_tab->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); + LTTV_TRACESET_CONTEXT(mw_data->current_tab->traceset_info-> + traceset_context),traceset); case GTK_RESPONSE_REJECT: case GTK_RESPONSE_CANCEL: default: gtk_widget_destroy((GtkWidget*)file_selector); break; } - g_printf("add a trace to a trace set\n"); } @@ -260,10 +261,11 @@ void remove_trace(GtkWidget * widget, gpointer user_data) char ** name, *remove_trace_name; MainWindow * mw_data = get_window_data_struct(widget); - nb_trace =lttv_traceset_number(mw_data->traceset_info->traceset); + nb_trace =lttv_traceset_number(mw_data->current_tab->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_v = lttv_traceset_get(mw_data->current_tab-> + traceset_info->traceset, i); trace = lttv_trace(trace_v); name[i] = trace->pathname; } @@ -273,16 +275,18 @@ void remove_trace(GtkWidget * widget, gpointer user_data) if(remove_trace_name){ for(i=0; itraceset_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); + traceset = mw_data->current_tab->traceset_info->traceset; + if(mw_data->current_tab->traceset_info->traceset_context != NULL){ + lttv_context_fini(LTTV_TRACESET_CONTEXT(mw_data->current_tab-> + traceset_info->traceset_context)); + g_object_unref(mw_data->current_tab->traceset_info->traceset_context); } lttv_traceset_remove(traceset, i); - mw_data->traceset_info->traceset_context = + mw_data->current_tab->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); + LTTV_TRACESET_CONTEXT(mw_data->current_tab-> + traceset_info->traceset_context),traceset); break; } } @@ -309,7 +313,8 @@ void zoom(GtkWidget * widget, double size) LttTime current_time, time_delta, time_s, time_e; MainWindow * mw_data = get_window_data_struct(widget); - time_span = LTTV_TRACESET_CONTEXT(mw_data->traceset_info->traceset_context)->Time_Span ; + time_span = LTTV_TRACESET_CONTEXT(mw_data->current_tab-> + traceset_info->traceset_context)->Time_Span; time_window = mw_data->current_tab->time_window; current_time = mw_data->current_tab->current_time; @@ -385,6 +390,7 @@ on_tab_activate (GtkMenuItem *menuitem, gpointer user_data) { gchar label[PATH_LENGTH]; + MainWindow * mw_data = get_window_data_struct((GtkWidget*)menuitem); GtkNotebook * notebook = (GtkNotebook *)lookup_widget((GtkWidget*)menuitem, "MNotebook"); if(notebook == NULL){ g_printf("Notebook does not exist\n"); @@ -392,9 +398,9 @@ on_tab_activate (GtkMenuItem *menuitem, } strcpy(label,"Page"); - get_label(NULL, label,"Get the name of the tab","Please input tab's name"); + get_label(mw_data, label,"Get the name of the tab","Please input tab's name"); - create_tab ((GtkWidget*)menuitem, notebook, label); + create_tab (mw_data, mw_data, notebook, label); } @@ -1015,8 +1021,7 @@ void insert_menu_toolbar_item(MainWindow * mw, gpointer user_data) } } -void construct_main_window(MainWindow * parent, WindowCreationData * win_creation_data, - gboolean first_window) +void construct_main_window(MainWindow * parent, WindowCreationData * win_creation_data) { g_critical("construct_main_window()"); GtkWidget * new_window; /* New generated main window */ @@ -1037,75 +1042,13 @@ void construct_main_window(MainWindow * parent, WindowCreationData * win_creatio new_m_window->attributes = attributes; - new_m_window->traceset_info = g_new(TracesetInfo,1); - new_m_window->traceset_info->path = NULL ; - - - new_m_window->traceset_info->before_traceset = lttv_hooks_new(); - new_m_window->traceset_info->after_traceset = lttv_hooks_new(); - new_m_window->traceset_info->before_trace = lttv_hooks_new(); - new_m_window->traceset_info->after_trace = lttv_hooks_new(); - new_m_window->traceset_info->before_tracefile = lttv_hooks_new(); - new_m_window->traceset_info->after_tracefile = lttv_hooks_new(); - new_m_window->traceset_info->before_event = lttv_hooks_new(); - new_m_window->traceset_info->after_event = lttv_hooks_new(); - - g_assert(lttv_iattribute_find_by_path(attributes, "hooks/traceset/before", - LTTV_POINTER, &value)); - *(value.v_pointer) = new_m_window->traceset_info->before_traceset; - g_assert(lttv_iattribute_find_by_path(attributes, "hooks/traceset/after", - LTTV_POINTER, &value)); - *(value.v_pointer) = new_m_window->traceset_info->after_traceset; - g_assert(lttv_iattribute_find_by_path(attributes, "hooks/trace/before", - LTTV_POINTER, &value)); - *(value.v_pointer) = new_m_window->traceset_info->before_trace; - g_assert(lttv_iattribute_find_by_path(attributes, "hooks/trace/after", - LTTV_POINTER, &value)); - *(value.v_pointer) = new_m_window->traceset_info->after_trace; - g_assert(lttv_iattribute_find_by_path(attributes, "hooks/tracefile/before", - LTTV_POINTER, &value)); - *(value.v_pointer) = new_m_window->traceset_info->before_tracefile; - g_assert(lttv_iattribute_find_by_path(attributes, "hooks/tracefile/after", - LTTV_POINTER, &value)); - *(value.v_pointer) = new_m_window->traceset_info->after_tracefile; - g_assert(lttv_iattribute_find_by_path(attributes, "hooks/event/before", - LTTV_POINTER, &value)); - *(value.v_pointer) = new_m_window->traceset_info->before_event; - g_assert(lttv_iattribute_find_by_path(attributes, "hooks/event/after", - LTTV_POINTER, &value)); - *(value.v_pointer) = new_m_window->traceset_info->after_event; - - new_m_window->mwindow = new_window; new_m_window->tab = NULL; new_m_window->current_tab = NULL; new_m_window->attributes = LTTV_IATTRIBUTE(g_object_new(LTTV_ATTRIBUTE_TYPE, NULL)); if(parent){ - new_m_window->traceset_info->traceset = - lttv_traceset_copy(parent->traceset_info->traceset); - -//FIXME copy not implemented in lower level - new_m_window->traceset_info->traceset_context = - g_object_new(LTTV_TRACESET_STATS_TYPE, NULL); - lttv_context_init( - LTTV_TRACESET_CONTEXT(new_m_window->traceset_info->traceset_context), - new_m_window->traceset_info->traceset); - //new_m_window->traceset_context = parent->traceset_context; new_m_window->win_creation_data = parent->win_creation_data; }else{ - new_m_window->traceset_info->traceset = lttv_traceset_new(); - - /* Add the command line trace */ - if(g_init_trace != NULL && first_window) - lttv_traceset_add(new_m_window->traceset_info->traceset, g_init_trace); - /* NOTE : the context must be recreated if we change the traceset, - * ie : adding/removing traces */ - new_m_window->traceset_info->traceset_context = - g_object_new(LTTV_TRACESET_STATS_TYPE, NULL); - lttv_context_init( - LTTV_TRACESET_CONTEXT(new_m_window->traceset_info->traceset_context), - new_m_window->traceset_info->traceset); - new_m_window->win_creation_data = win_creation_data; } @@ -1128,7 +1071,7 @@ void construct_main_window(MainWindow * parent, WindowCreationData * win_creatio } //for now there is no name field in LttvTraceset structure //Use "Traceset" as the label for the default tab - create_tab(new_m_window->mwindow, notebook,"Traceset"); + create_tab(NULL, new_m_window, notebook,"Traceset"); g_object_set_data_full( G_OBJECT(new_m_window->mwindow), @@ -1141,6 +1084,9 @@ void construct_main_window(MainWindow * parent, WindowCreationData * win_creatio void tab_destructor(Tab * tab_instance) { + int i, nb, ref_count; + LttvTrace * trace; + if(tab_instance->attributes) g_object_unref(tab_instance->attributes); @@ -1154,17 +1100,34 @@ void tab_destructor(Tab * tab_instance) } tmp1->next = tab_instance->next; } + + if(tab_instance->traceset_info->traceset_context != NULL){ + lttv_context_fini(LTTV_TRACESET_CONTEXT(tab_instance->traceset_info-> + traceset_context)); + g_object_unref(tab_instance->traceset_info->traceset_context); + } + if(tab_instance->traceset_info->traceset != NULL) { + nb = lttv_traceset_number(tab_instance->traceset_info->traceset); + for(i = 0 ; i < nb ; i++) { + trace = lttv_traceset_get(tab_instance->traceset_info->traceset, i); + ref_count = lttv_trace_get_ref_number(trace); + if(ref_count <= 1) + ltt_trace_close(lttv_trace(trace)); + } + } + lttv_traceset_destroy(tab_instance->traceset_info->traceset); + g_free(tab_instance->traceset_info); g_free(tab_instance); } -void * create_tab(GtkWidget* parent, GtkNotebook * notebook, char * label) +void * create_tab(MainWindow * parent, MainWindow* current_window, + GtkNotebook * notebook, char * label) { GList * list; Tab * tmp_tab; - MainWindow * mw_data; + MainWindow * mw_data = current_window; LttTime tmp_time; - mw_data = get_window_data_struct(parent); tmp_tab = mw_data->tab; while(tmp_tab && tmp_tab->next) tmp_tab = tmp_tab->next; if(!tmp_tab){ @@ -1175,25 +1138,47 @@ void * create_tab(GtkWidget* parent, GtkNotebook * notebook, char * label) tmp_tab->next = g_new(Tab,1); tmp_tab = tmp_tab->next; } + + tmp_tab->traceset_info = g_new(TracesetInfo,1); + if(parent){ + tmp_tab->traceset_info->traceset = + lttv_traceset_copy(parent->current_tab->traceset_info->traceset); + }else{ + if(mw_data->current_tab){ + tmp_tab->traceset_info->traceset = + lttv_traceset_copy(mw_data->current_tab->traceset_info->traceset); + }else{ + tmp_tab->traceset_info->traceset = lttv_traceset_new(); + } + + /* Add the command line trace */ + if(g_init_trace != NULL && parent == NULL) + lttv_traceset_add(tmp_tab->traceset_info->traceset, g_init_trace); + } + //FIXME copy not implemented in lower level + tmp_tab->traceset_info->traceset_context = + g_object_new(LTTV_TRACESET_STATS_TYPE, NULL); + lttv_context_init( + LTTV_TRACESET_CONTEXT(tmp_tab->traceset_info->traceset_context), + tmp_tab->traceset_info->traceset); + if(mw_data->current_tab){ - // Will have to read directly at the main window level, as we want - // to be able to modify a traceset on the fly. - // tmp_tab->traceStartTime = mw_data->current_tab->traceStartTime; - // tmp_tab->traceEndTime = mw_data->current_tab->traceEndTime; + // Will have to read directly at the main window level, as we want + // to be able to modify a traceset on the fly. tmp_tab->time_window = mw_data->current_tab->time_window; tmp_tab->current_time = mw_data->current_tab->current_time; }else{ - // Will have to read directly at the main window level, as we want - // to be able to modify a traceset on the fly. - // get_traceset_time_span(mw_data,&tmp_tab->traceStartTime, &tmp_tab->traceEndTime); + // Will have to read directly at the main window level, as we want + // to be able to modify a traceset on the fly. + // get_traceset_time_span(mw_data,&tmp_tab->traceStartTime, &tmp_tab->traceEndTime); tmp_tab->time_window.start_time = - LTTV_TRACESET_CONTEXT(mw_data->traceset_info->traceset_context)->Time_Span->startTime; + LTTV_TRACESET_CONTEXT(tmp_tab->traceset_info->traceset_context)->Time_Span->startTime; if(DEFAULT_TIME_WIDTH_S < - LTTV_TRACESET_CONTEXT(mw_data->traceset_info->traceset_context)->Time_Span->endTime.tv_sec) + LTTV_TRACESET_CONTEXT(tmp_tab->traceset_info->traceset_context)->Time_Span->endTime.tv_sec) tmp_time.tv_sec = DEFAULT_TIME_WIDTH_S; else tmp_time.tv_sec = - LTTV_TRACESET_CONTEXT(mw_data->traceset_info->traceset_context)->Time_Span->endTime.tv_sec; + LTTV_TRACESET_CONTEXT(tmp_tab->traceset_info->traceset_context)->Time_Span->endTime.tv_sec; tmp_time.tv_nsec = 0; tmp_tab->time_window.time_width = tmp_time ; tmp_tab->current_time.tv_sec = tmp_time.tv_sec / 2; diff --git a/ltt/branches/poly/lttv/modules/gui/mainWin/src/callbacks.h b/ltt/branches/poly/lttv/modules/gui/mainWin/src/callbacks.h index b3cfd41c..95a24cb9 100644 --- a/ltt/branches/poly/lttv/modules/gui/mainWin/src/callbacks.h +++ b/ltt/branches/poly/lttv/modules/gui/mainWin/src/callbacks.h @@ -6,8 +6,7 @@ void create_new_window(GtkWidget* widget, gpointer user_data, gboolean clone); void insert_menu_toolbar_item(MainWindow * mw, gpointer user_data); -void construct_main_window(MainWindow * parent, WindowCreationData *win_creation_data, - gboolean first_window); +void construct_main_window(MainWindow * parent, WindowCreationData *win_creation_data); void main_window_free(MainWindow * mw); void main_window_destructor(MainWindow * mw); diff --git a/ltt/branches/poly/lttv/modules/gui/mainWin/src/gtkcustom.c b/ltt/branches/poly/lttv/modules/gui/mainWin/src/gtkcustom.c index 1d4c68aa..05f56448 100644 --- a/ltt/branches/poly/lttv/modules/gui/mainWin/src/gtkcustom.c +++ b/ltt/branches/poly/lttv/modules/gui/mainWin/src/gtkcustom.c @@ -111,7 +111,8 @@ void gtk_custom_set_adjust(GtkCustom * custom, gboolean first_time) get_time_window(custom->mw,&time_window); if(first_time){ - time_span = LTTV_TRACESET_CONTEXT(custom->mw->traceset_info->traceset_context)->Time_Span ; + time_span = LTTV_TRACESET_CONTEXT(custom->mw->current_tab->traceset_info-> + traceset_context)->Time_Span ; custom->hadjust->lower = ltt_time_to_double(time_span->startTime) * NANOSECONDS_PER_SECOND; diff --git a/ltt/branches/poly/lttv/modules/gui/mainWin/src/init_module.c b/ltt/branches/poly/lttv/modules/gui/mainWin/src/init_module.c index 1cee6afe..1fe80b54 100644 --- a/ltt/branches/poly/lttv/modules/gui/mainWin/src/init_module.c +++ b/ltt/branches/poly/lttv/modules/gui/mainWin/src/init_module.c @@ -75,7 +75,7 @@ static gboolean window_creation_hook(void *hook_data, void *call_data) add_pixmap_directory ("pixmaps"); add_pixmap_directory ("modules/gui/mainWin/pixmaps"); - construct_main_window(NULL, window_creation_data, TRUE); + construct_main_window(NULL, window_creation_data); gtk_main (); @@ -110,45 +110,8 @@ G_MODULE_EXPORT void init(LttvModule *self, int argc, char *argv[]) { void main_window_free(MainWindow * mw) { - guint i, nb, ref_count; - LttvTrace * trace; - if(mw){ - -g_critical("begin remove"); - lttv_hooks_destroy(mw->traceset_info->before_traceset); - lttv_hooks_destroy(mw->traceset_info->after_traceset); - lttv_hooks_destroy(mw->traceset_info->before_trace); - lttv_hooks_destroy(mw->traceset_info->after_trace); - lttv_hooks_destroy(mw->traceset_info->before_tracefile); - lttv_hooks_destroy(mw->traceset_info->after_tracefile); - lttv_hooks_destroy(mw->traceset_info->before_event); - lttv_hooks_destroy(mw->traceset_info->after_event); -g_critical("end remove"); - - if(mw->traceset_info->path != NULL) - g_free(mw->traceset_info->path); - if(mw->traceset_info->traceset_context != NULL){ - lttv_context_fini(LTTV_TRACESET_CONTEXT(mw->traceset_info->traceset_context)); - g_object_unref(mw->traceset_info->traceset_context); - } - if(mw->traceset_info->traceset != NULL) { - nb = lttv_traceset_number(mw->traceset_info->traceset); - for(i = 0 ; i < nb ; i++) { - trace = lttv_traceset_get(mw->traceset_info->traceset, i); - ref_count = lttv_trace_get_ref_number(trace); - if(ref_count <= 1) - ltt_trace_close(lttv_trace(trace)); - } - } - - lttv_traceset_destroy(mw->traceset_info->traceset); - g_object_unref(mw->attributes); - - g_free(mw->traceset_info); - mw->traceset_info = NULL; - g_main_window_list = g_slist_remove(g_main_window_list, mw); g_hash_table_destroy(mw->hash_menu_item); -- 2.34.1