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

BooleanExpression created by methods and(), or(). are not cleaned

    Details

    • Subcomponent:

      Description

      BooleanExpression (and other observable values) created by methods not(), and(), or() etc.. are not cleaned from memory until all of the objects used during its creating are cleaned.

      showAll = new SimpleBooleanProperty();
      ToggleButton tb = new ToggleButton();
      tb.visibleProperty().bind(tb.selectedProperty().or(showAll));
      tb.visibleProperty().unbind();
      tb = null;

      The BooleanExpression in the third line of aforementioned code stays in memory untill the showAll property is cleaned. It also holds all the objects used during its creating. That means the toggle button stays in memory as well.

      I'm not sure whether it is bug or just strange behavior, but it makes these methods completely unusable and it should be at least mentioned in documentation.

        Attachments

          Activity

            People

            • Assignee:
              msladecek Martin Sládeček
              Reporter:
              dpelisekjfx Daniel Pelisek (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported: