X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=ltt%2Fbranches%2Fpoly%2Flttv%2Fmodules%2Fgui%2Flttvwindow%2Flttvwindow%2Finit_module.c;h=f39cc9abe67f878365fb852be450fcb581548343;hb=47cd8a0916562272d1b0da947a2bc78cc021dd93;hp=a6d63cb348aeaec6ef9570ee54327c30a4336932;hpb=754351700b3d5fb6112e72dd4722a546abc219f1;p=lttv.git diff --git a/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/init_module.c b/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/init_module.c index a6d63cb3..f39cc9ab 100644 --- a/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/init_module.c +++ b/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/init_module.c @@ -41,6 +41,7 @@ #include "interface.h" #include "support.h" #include +#include #include "callbacks.h" #include @@ -115,51 +116,18 @@ static void init() { LTTV_POINTER, &value)); g_assert((main_hooks = *(value.v_pointer)) != NULL); - lttv_hooks_add(main_hooks, window_creation_hook, NULL); + lttv_hooks_add(main_hooks, window_creation_hook, NULL, LTTV_PRIO_DEFAULT); } -void -main_window_free(MainWindow * mw) -{ - if(mw){ - while(mw->tab){ - lttv_state_remove_event_hooks( - (LttvTracesetState*)mw->tab->traceset_info->traceset_context); - mw->tab = mw->tab->next; - } - g_object_unref(mw->attributes); - g_main_window_list = g_slist_remove(g_main_window_list, mw); - - g_hash_table_destroy(mw->hash_menu_item); - g_hash_table_destroy(mw->hash_toolbar_item); - - g_free(mw); - mw = NULL; - } -} - void main_window_destructor(MainWindow * mw) { - if(GTK_IS_WIDGET(mw->mwindow)){ - gtk_widget_destroy(mw->mwindow); - // gtk_widget_destroy(mw->HelpContents); - // gtk_widget_destroy(mw->AboutBox); - mw = NULL; - } - //main_window_free called when the object mw in the widget is unref. - //main_window_free(mw); + g_assert(GTK_IS_WIDGET(mw->mwindow)); + gtk_widget_destroy(mw->mwindow); } -void main_window_destroy_walk(gpointer data, gpointer user_data) -{ - main_window_destructor((MainWindow*)data); -} - - - /** * plugin's destroy function * @@ -170,7 +138,8 @@ static void destroy() { LttvAttributeValue value; LttvTrace *trace; - + GSList *iter = NULL; + lttv_option_remove("trace"); lttv_hooks_remove_data(main_hooks, window_creation_hook, NULL); @@ -178,7 +147,9 @@ static void destroy() { g_debug("GUI destroy()"); if(g_main_window_list){ - g_slist_foreach(g_main_window_list, main_window_destroy_walk, NULL ); + for(iter=g_main_window_list;iter!=NULL;iter=g_slist_next(iter)) { + main_window_destructor((MainWindow*)iter->data); + } g_slist_free(g_main_window_list); } @@ -187,4 +158,4 @@ static void destroy() { LTTV_MODULE("lttvwindow", "Viewer main window", \ "Viewer with multiple windows, tabs and panes for graphical modules", \ - init, destroy, "stats") + init, destroy, "stats", "option")