Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8124154

Not garbaged children of pane after removing them one by one

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 7u6
    • Fix Version/s: 8
    • Component/s: javafx
    • Labels:

      Description

      If I add new children to a Pane and afterwards delete them one by one, some of them still stay in memory even if there is no reference to them

      HBox main = new HBox();
      Set<Button> buttons = new HashSet<Button>();

      for (int i = 0; i < 100; i++) {
      Button b = new Button();
      buttons.add(b);
      main.getChildren().add(b);
      }

      for (Button b : buttons) {
      main.getChildren().remove(b);
      }

      buttons.clear();

      in aforementioned code 20 from 100 Buttons stay uncleaned. If I use main.getChildren().clear() everything works fine.

        Attachments

          Activity

            People

            • Assignee:
              psafrata Pavel Ĺ afrata
              Reporter:
              dpelisekjfx Daniel Pelisek (Inactive)
            • Votes:
              1 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported: