[Base, Events] addEventListener Memory Leak on Grand Parent

XMLWordPrintable

    • Type: Bug
    • Resolution: Not an Issue
    • Priority: P5
    • 8u20
    • Affects Version/s: 7u7
    • Component/s: javafx
    • None

      The anonymous inner class is not released here, causing a memory leak.
      anchorPane is an AnchorPane, while grandParentButton and someButtonInsideAnchorPane are Buttons.

      anchorPane.getParent().getParent().lookup("#grandParentButton").addEventFilter(KeyEvent.KEY_PRESSED, new EventHandler<KeyEvent>() {
              @Override
              public void handle(KeyEvent e) {
                  if (e.getCode() == KeyCode.ENTER) {
                      someButtonInsideAnchorPane.requestFocus();
                      e.consume();
                  }
              }
          });

            Assignee:
            Martin Sládeček
            Reporter:
            J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: