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

[Base, Events] addEventListener Memory Leak on Grand Parent

    Details

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

      Description

      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();
                  }
              }
          });

        Attachments

          Activity

            People

            • Assignee:
              msladecek Martin Sládeček
              Reporter:
              duke J. Duke (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported: