jiangtiandao / flexlib

Automatically exported from code.google.com/p/flexlib
0 stars 0 forks source link

Infinite loop validating ScrollableMenu #271

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
To reproduce, just open a ScrollableMenu in a Flex 3.5 application.

I don't know exactly since which Flex version this is broken; somewhere
between 3.2 where it works and 3.5 where I see it's broken).

The cause of the problem is that ScrollableMenu.measure calls
commitProperties() at the end. There is no apparent reason for doing this:
measure doesn't change any properties that require a commit.
This, in combination with a bug in the Flex Menu
(https://bugs.adobe.com/jira/browse/SDK-24917) causes an infinite loop in
LayoutManager.validateClient while trying to validate the menu.
It first validates the properties which invalidates the size (because it
always thinks the dataProvider has changed); next it validates the size
which invalidates properties (because of the commitProperties() call in
ScrollableMenu.measure), so it validates properties again,...

The fix is simple: just remove the commitProperties() call in
ScrollableMenu.measure.
It might be a workaround for another problem, but it really doesn't belong
there. If you'd really want a minimal-risk change to fix this, you could
change commitProperties() into invalidateProperties(); if there's an ugly
reason properties that are invalid have to be validated right there, that
would still do the trick.

Original issue reported on code.google.com by coekie on 6 Jan 2010 at 3:59

GoogleCodeExporter commented 8 years ago
Thanks coekie! Ran in the same issue updating an application from Flex SDK 
3.4.1 to 3.5. 

Unfortunately calling invalidateProperties() in measure() wont stop the endless 
loop
there. Anyway, as you pointed out just remove commitProperties() and you are 
fine.

Thanks again!

-Jens
http://www.websector.de

Original comment by sect...@gmail.com on 19 Jan 2010 at 3:43

GoogleCodeExporter commented 8 years ago
removing the line cause unwanted behaviour for me. I use the following solution:
this.callLater( commitProperties );

Original comment by mikach...@gmail.com on 3 Feb 2010 at 10:19

GoogleCodeExporter commented 8 years ago
mikachu: Could you be more precise which unwanted behaviour you get, and how to
reproduce that?

Original comment by coekie on 8 Feb 2010 at 10:32

GoogleCodeExporter commented 8 years ago

Original comment by olarivain@gmail.com on 29 Mar 2010 at 1:30

GoogleCodeExporter commented 8 years ago
I've commented out the call to commitproperties, it seems to be working. 
mikachu, I 
would be very happy to hear more about the unwanted behaviour :)

Marking as fixed for now.

Original comment by olarivain@gmail.com on 29 Mar 2010 at 8:18

GoogleCodeExporter commented 8 years ago
Ran into the same issue when upgraded to 3.5, with flash player 10.0.35. 
However, it 
ran fine on FP 9. 

-Shailesh
www.getzephyr.com

Original comment by shailesh...@gmail.com on 13 Apr 2010 at 11:27