From: Enlightenment S. <no-...@en...> - 2011-10-31 23:22:15
|
Log: E: gadcon width adjustment was entering an infinite loop if no gadget had autoscroll enabled the 'need' variable had to be initialized to 0, and a break condition for the loop also needed to be added otherwise we'd end up in an infinite loop if no gadget had autoscroll (in which case, the need var was never modified). Author: kakaroto Date: 2011-10-31 16:22:07 -0700 (Mon, 31 Oct 2011) New Revision: 64587 Trac: http://trac.enlightenment.org/e/changeset/64587 Modified: trunk/e/src/bin/e_gadcon.c Modified: trunk/e/src/bin/e_gadcon.c =================================================================== --- trunk/e/src/bin/e_gadcon.c 2011-10-31 22:47:35 UTC (rev 64586) +++ trunk/e/src/bin/e_gadcon.c 2011-10-31 23:22:07 UTC (rev 64587) @@ -3715,7 +3715,8 @@ E_Gadcon_Layout_Item *bi = NULL; Eina_List *l, *l2; Evas_Object *item; - int need; + int needed = 0; + int need = 0; int max_size, autosize = 0; if (sd->w < cur) @@ -3738,6 +3739,7 @@ if (autosize < 1) autosize = 1; while (need > 0) { + needed = need; EINA_LIST_REVERSE_FOREACH(sd->items, l2, item) { if (need <= 0) break; @@ -3760,6 +3762,9 @@ } } } + /* If the 'needed' size change didn't get modified (no gadget has autoscroll) + then we must break or we end up in an infinite loop */ + if (need == needed) break; } } |