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

RadioButtons created in nested containers are not garbage collected when the containers children are removed, causing memory leak

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • Adobe Flex SDK 3.5 (Release)
    • None
    • mx: RadioButton
    • None
    • Affected OS(s): All OS Platforms
      Affected OS(s): All OS Platforms
      Language Found: English

    Description

      Steps to reproduce:
      1.Dynamically created N RadioButtons inside GridRows/GridItems of a Grid myGrid
      2.Call myGrid.removeAllChildren();
      3.The radio buttons are still referenced in the automaticRadioButtonGroups, and won't be garbage collected
      document.automaticRadioButtonGroups[groupName].radioButtons

      Actual Results:
      The radio buttons are not garbage collected

      Expected Results:
      The radio buttons must be garbage collected

      Workaround (if any):
      use an explicit RadioButtonGroup and clear it/ renew it manually after the removeAll();

      NB: looking at the open source code, the bug seems to be in the RadioButtonGroup.addInstance() function:
      mx_internal function addInstance(instance:RadioButton):void

      { instance.indexNumber = indexNumber++; instance.addEventListener(Event.REMOVED, radioButton_removedHandler); }

      should use Event.REMOVED_FROM_STAGE instead of Event.REMOVED.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated: