#include "../icons/hGuiStatisticInsert.xpm"
+#define g_info(format...) g_log (G_LOG_DOMAIN, G_LOG_LEVEL_INFO, format)
+#define g_debug(format...) g_log (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, format)
+
#define PATH_LENGTH 256
static LttvModule *Main_Win_Module;
/** Array containing instanced objects. Used when module is unloaded */
-GSList *gStatistic_Viewer_Data_List = NULL ;
+static GSList *gStatistic_Viewer_Data_List = NULL ;
typedef struct _StatisticViewerData StatisticViewerData;
void grab_focus(GtkWidget *widget, gpointer data);
static void tree_selection_changed_cb (GtkTreeSelection *selection, gpointer data);
-void Destroy_hash_key(gpointer key);
-void Destroy_hash_data(gpointer data);
+void statistic_destroy_hash_key(gpointer key);
+void statistic_destroy_hash_data(gpointer data);
void get_traceset_stats(StatisticViewerData * Statistic_Viewer_Data);
void show_traceset_stats(StatisticViewerData * Statistic_Viewer_Data);
}
-void destroy_walk(gpointer data, gpointer user_data)
+void statistic_destroy_walk(gpointer data, gpointer user_data)
{
GuiStatistic_Destructor((StatisticViewerData*)data);
}
G_MODULE_EXPORT void destroy() {
int i;
- StatisticViewerData *Statistic_Viewer_Data;
-
g_critical("GUI Statistic Viewer destroy()");
- g_slist_foreach(gStatistic_Viewer_Data_List, destroy_walk, NULL );
-
- g_slist_free(gStatistic_Viewer_Data_List);
+ if(gStatistic_Viewer_Data_List){
+ g_slist_foreach(gStatistic_Viewer_Data_List, statistic_destroy_walk, NULL );
+ g_slist_free(gStatistic_Viewer_Data_List);
+ }
/* Unregister the toolbar insert button */
ToolbarItemUnreg(hGuiStatistic);
void
GuiStatistic_free(StatisticViewerData *Statistic_Viewer_Data)
{
+ g_critical("GuiStatistic_free()");
if(Statistic_Viewer_Data){
g_hash_table_destroy(Statistic_Viewer_Data->Statistic_Hash);
gStatistic_Viewer_Data_List = g_slist_remove(gStatistic_Viewer_Data_List, Statistic_Viewer_Data);
void
GuiStatistic_Destructor(StatisticViewerData *Statistic_Viewer_Data)
{
+ g_critical("GuiStatistic_Destructor()");
/* May already been done by GTK window closing */
if(GTK_IS_WIDGET(Statistic_Viewer_Data->HPaned_V)){
gtk_widget_destroy(Statistic_Viewer_Data->HPaned_V);
Statistic_Viewer_Data = NULL;
}
-
- GuiStatistic_free(Statistic_Viewer_Data);
+ //GuiStatistic_free(Statistic_Viewer_Data);
}
Statistic_Viewer_Data->stats = getTracesetStats(Statistic_Viewer_Data->mw);
Statistic_Viewer_Data->Statistic_Hash = g_hash_table_new_full(g_str_hash, g_str_equal,
- Destroy_hash_key, Destroy_hash_data);
+ statistic_destroy_hash_key,
+ statistic_destroy_hash_data);
Statistic_Viewer_Data->HPaned_V = gtk_hpaned_new();
Statistic_Viewer_Data->Store_M = gtk_tree_store_new (N_COLUMNS, G_TYPE_STRING);
(GDestroyNotify)GuiStatistic_free);
/* Add the object's information to the module's array */
- gStatistic_Viewer_Data_List = g_slist_append(gStatistic_Viewer_Data_List, Statistic_Viewer_Data);
+ gStatistic_Viewer_Data_List = g_slist_append(
+ gStatistic_Viewer_Data_List,
+ Statistic_Viewer_Data);
get_traceset_stats(Statistic_Viewer_Data);
}
}
-void Destroy_hash_key(gpointer key)
+void statistic_destroy_hash_key(gpointer key)
{
g_free(key);
}
-void Destroy_hash_data(gpointer data)
+void statistic_destroy_hash_data(gpointer data)
{
// g_free(data);
}