#include "interface.h"
#include "support.h"
#include <lttvwindow/mainwindow.h>
+#include <lttvwindow/mainwindow-private.h>
#include "callbacks.h"
#include <ltt/trace.h>
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_destructor(MainWindow * mw)
{
- if(GTK_IS_WIDGET(mw->mwindow)){
- gtk_widget_destroy(mw->mwindow);
- mw = NULL;
- }
-}
-
-
-void main_window_destroy_walk(gpointer data, gpointer user_data)
-{
- main_window_destructor((MainWindow*)data);
+ g_assert(GTK_IS_WIDGET(mw->mwindow));
+ gtk_widget_destroy(mw->mwindow);
}
-
/**
* plugin's destroy function
*
LttvAttributeValue value;
LttvTrace *trace;
-
+ GSList *iter = NULL;
+
lttv_option_remove("trace");
lttv_hooks_remove_data(main_hooks, window_creation_hook, NULL);
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);
}
LTTV_MODULE("lttvwindow", "Viewer main window", \
"Viewer with multiple windows, tabs and panes for graphical modules", \
- init, destroy, "stats")
+ init, destroy, "stats", "option")