enhancements and bugfixes
[lttv.git] / ltt / branches / poly / lttv / modules / gui / controlflow / processlist.c
index 4145f745ddbdaeeccee2447f69b1b2b096e30452..6c450afe6b72cb41c9ed60e0c4ef151d0c32d36a 100644 (file)
 #include "processlist.h"
 #include "drawitem.h"
 
+#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)
+
+
 /*****************************************************************************
  *                       Methods to synchronize process list                 *
  *****************************************************************************/
@@ -234,7 +238,6 @@ ProcessList *processlist_construct(void)
   process_list->process_list_widget = 
     gtk_tree_view_new_with_model
     (GTK_TREE_MODEL (process_list->list_store));
-
   g_object_unref (G_OBJECT (process_list->list_store));
 
   gtk_tree_sortable_set_sort_func(
@@ -320,10 +323,12 @@ ProcessList *processlist_construct(void)
 }
 void processlist_destroy(ProcessList *process_list)
 {
+  g_info("processlist_destroy %p", process_list);
   g_hash_table_destroy(process_list->process_hash);
   process_list->process_hash = NULL;
 
   g_free(process_list);
+  g_info("processlist_destroy end");
 }
 
 GtkWidget *processlist_get_widget(ProcessList *process_list)
@@ -361,7 +366,7 @@ int processlist_add(  ProcessList *process_list,
       guint pid,
       LttTime *birth,
       guint trace_num,
-      gchar *name,
+      const gchar *name,
       guint *height,
       HashedProcessData **pm_hashed_process_data)
 {
@@ -475,12 +480,16 @@ int processlist_remove( ProcessList *process_list,
           process_list->process_hash,
           &Process_Info))
   {
+    GtkTreePath *tree_path;
+
+    tree_path = gtk_tree_row_reference_get_path(
+                    hashed_process_data->row_ref);
+
     gtk_tree_model_get_iter (
         GTK_TREE_MODEL(process_list->list_store),
-        &iter,
-        gtk_tree_row_reference_get_path(
-          (GtkTreeRowReference*)hashed_process_data->row_ref)
-        );
+        &iter, tree_path);
+    gtk_tree_path_free(tree_path);
 
     gtk_list_store_remove (process_list->list_store, &iter);
     
@@ -548,6 +557,8 @@ gint processlist_get_process_pixels(  ProcessList *process_list,
         GTK_TREE_VIEW(process_list->process_list_widget));
     *y = *height * path_indices[0];
     *pm_hashed_process_data = hashed_process_data;
+    gtk_tree_path_free(tree_path);
+    
     return 0; 
   } else {
     *pm_hashed_process_data = hashed_process_data;
@@ -573,6 +584,7 @@ gint processlist_get_pixels_from_data(  ProcessList *process_list,
   *height = get_cell_height(
       GTK_TREE_VIEW(process_list->process_list_widget));
   *y = *height * path_indices[0];
+  gtk_tree_path_free(tree_path);
 
   return 0; 
 
This page took 0.023637 seconds and 4 git commands to generate.