Uploaded image for project: 'Apache Flex'
  1. Apache Flex
  2. FLEX-22202

List.purgeMeasuringRenderers() des not clear the measuringObjects Dictionary

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Later
    • Adobe Flex SDK Previous
    • None
    • mx: List
    • None
    • Affected OS(s): All OS Platforms
      Language Found: English

    Description

      The code for mx:List in both SDK 3.4 and SDK 4.0 is:

      mx_internal function purgeMeasuringRenderers():void

      { var item:IListItemRenderer; for each (item in measuringObjects) if (item.parent) item.parent.removeChild(DisplayObject(item)); if (!measuringObjects) measuringObjects = new Dictionary(true); }

      In the last "if" clause, a new Dictionary is created only if measuringObject is null. If measuringObjects exists, then the items are removed from their parent by the "for" loop, but the items themselves remain in the measuringObjects Dictionary. This is a memory leak.

      I believe the intent of the function is the following:

      mx_internal function purgeMeasuringRenderers():void
      {
      if (measuringObjects)

      { for each (var item:IListItemRenderer in measuringObjects) if (item.parent) item.parent.removeChild(DisplayObject(item)); }

      measuringObjects = new Dictionary(true);
      }

      Attachments

        Activity

          People

            adobejira Adobe JIRA
            adobejira Adobe JIRA
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: