#include "support.h"
#include <lttv/mainWindow.h>
#include "callbacks.h"
+#include <ltt/trace.h>
+
/* global variable */
-//LttvTracesetStats * gTracesetContext = NULL;
-//static LttvTraceset * traceset;
static WindowCreationData win_creation_data;
/** Array containing instanced objects. */
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 ();
}
void
-main_window_free(mainWindow * mw)
+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->TracesetContext != NULL){
- lttv_context_fini(LTTV_TRACESET_CONTEXT(mw->Traceset_Info->TracesetContext));
- g_object_unref(mw->Traceset_Info->TracesetContext);
+ while(mw->tab){
+ lttv_state_remove_event_hooks(
+ (LttvTracesetState*)mw->tab->traceset_info->traceset_context);
+ mw->tab = mw->tab->next;
}
- 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_object_unref(mw->attributes);
g_main_window_list = g_slist_remove(g_main_window_list, mw);
g_hash_table_destroy(mw->hash_menu_item);
}
void
-main_window_destructor(mainWindow * mw)
+main_window_destructor(MainWindow * mw)
{
- if(GTK_IS_WIDGET(mw->MWindow)){
- gtk_widget_destroy(mw->MWindow);
+ if(GTK_IS_WIDGET(mw->mwindow)){
+ gtk_widget_destroy(mw->mwindow);
// gtk_widget_destroy(mw->HelpContents);
// gtk_widget_destroy(mw->AboutBox);
mw = NULL;
void main_window_destroy_walk(gpointer data, gpointer user_data)
{
- main_window_destructor((mainWindow*)data);
+ main_window_destructor((MainWindow*)data);
}