no more after_request on remove_all
[lttv.git] / ltt / branches / poly / lttv / modules / gui / lttvwindow / lttvwindow / callbacks.c
index 0ac6bea95ed1ea7224ab40d0fa72e33659048180..128b420229c0f345ef741168f7d4c28b15f215ab 100644 (file)
@@ -740,10 +740,13 @@ gboolean lttvwindow_process_pending_requests(Tab *tab)
 
   
   /* Events processing algorithm implementation */
+  /* Warning : the gtk_events_pending takes a LOT of cpu time. So what we do
+   * instead is to leave the control to GTK and take it back.
+   */
   /* A. Servicing loop */
-  while( (g_slist_length(list_in) != 0 || g_slist_length(list_out) != 0)) {
-     /*    && !gtk_events_pending() )  */
-
+  //while( (g_slist_length(list_in) != 0 || g_slist_length(list_out) != 0)) {
+  if((g_slist_length(list_in) != 0 || g_slist_length(list_out) != 0)) {
+    /* Servicing */
     /* 1. If list_in is empty (need a seek) */
     if( g_slist_length(list_in) ==  0 ) {
 
@@ -1011,7 +1014,7 @@ gboolean lttvwindow_process_pending_requests(Tab *tab)
                                              events_request->event,
                                              events_request->event_by_id);
           }
+
           /* Go to next */
           if(remove)
           {
@@ -1113,8 +1116,11 @@ gboolean lttvwindow_process_pending_requests(Tab *tab)
       count = lttv_process_traceset_middle(tsc, end_time, end_nb_events, end_position);
 
       tfc = lttv_traceset_context_get_current_tfc(tsc);
-      g_debug("Context time after middle : %lu, %lu", tfc->timestamp.tv_sec,
+      if(tfc != NULL)
+        g_debug("Context time after middle : %lu, %lu", tfc->timestamp.tv_sec,
                                                         tfc->timestamp.tv_nsec);
+      else
+        g_debug("End of trace reached after middle.");
 
     }
     {
@@ -1231,9 +1237,10 @@ gboolean lttvwindow_process_pending_requests(Tab *tab)
         }
       }
     }
-
-    if(gtk_events_pending()) break;
   }
+  /* End of removed servicing loop : leave control to GTK instead. */
+  //  if(gtk_events_pending()) break;
+  //}
 
   /* B. When interrupted between chunks */
 
This page took 0.024844 seconds and 4 git commands to generate.