Sunday, March 28, 2010

RichEditableText Infinite Loop

I've attached a picture of the stack trace for an infinite loop that happens often in the RichEditableText component:

If I add a bunch of item renderers to a list, where each item renderer has a TextArea that gets its TextFlow from the list's data item, the TLF dispatches a DAMAGE event, which the RichEditableText ''textContainerManager_damageHandler'' handles, calling invalidateDisplayList, which causes the DAMAGE event to be dispatched again.

Any fix for this??I've already posted a more detailed bug report:

https://bugs.adobe.com/jira/browse/SDK-23002

Thanks for the help, the browser crashes with this bug.

Lance

RichEditableText Infinite Loop

i had to compress the file...

RichEditableText Infinite Loop

This also occurs when two objects have a reference to the same TextFlow, because the _eventDispatcher is set to the first one it was passed to, so when one change, both change cyclically.

The problem is that if you pass around the TextFlow object to multiple RichTexts or RichEditableTexts, the damage event handlers are all referencing that same TextFlow object, so it never gets resolved.

WORKAROUND: TextFlowUtil.clone(textFlow);

public static function clone(textFlow:TextFlow):TextFlow

{

return importFromXML(export(textFlow));

}

You can also just use ''textFlow.shallowClone() as TextFlow''

- Lance

No comments:

Post a Comment