X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=ltt%2Fbranches%2Fpoly%2Flttv%2Fmodules%2Fgui%2Flttvwindow%2Flttvwindow%2Finit_module.c;h=21a30eedaaa354dbef12304f8772a6255fc39638;hb=45653836d75635b5b841d0d03f1f0789348adc56;hp=c9f55de6a6e90a9b1195ad4bde846ebb810d8282;hpb=79257ba540581e198c9d9b047fe0738a25c324ff;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 c9f55de6..21a30eed 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 @@ -233,6 +233,10 @@ main_window_destructor(MainWindow * mw) gtk_widget_destroy(mw->mwindow); } +static void destroy_walk(gpointer data, gpointer user_data) +{ + main_window_destructor((MainWindow*)data); +} /** * plugin's destroy function @@ -252,12 +256,9 @@ static void destroy() { g_debug("GUI destroy()"); - if(g_main_window_list){ - 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); - } + g_slist_foreach(g_main_window_list, destroy_walk, NULL); + + g_slist_free(g_main_window_list); }