Re: gtk_events_pending() seems to spin sometimes?


Maybe the line
   printf("%s: will do: gtk_main_iteration ", __FUNCTION__);

 into the loop create a new event to iteration, then drop this line and test.



Ben Johnson escreveu:


I have a loop that looks like this...

while( gtk_events_pending () )
   printf("%s: will do: gtk_main_iteration ", __FUNCTION__);
   gtk_main_iteration ();

If I understand right, that should be pretty standard GTK+ code.  Sometimes
when my program hits this loop, gtk_events_pending() blocks forever and
my application starts using all the cpu cycles.  If I attach to it with
gdb I get a back trace that looks something like this:

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]