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

Binding and Unbinding to List leads to memory leak

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P3 P3
    • tbd
    • jfx17
    • javafx
    • None

      Found by Dirk Lemmermann,

      So elegant now, to describe these bugs with a simple unit test. :)

      @Test
          public void shouldCollectBoundListProperty() {
              JMemoryBuddy.memoryTest(checker -> {

                  // given
                  ListProperty<Object> listA = new SimpleListProperty<>(FXCollections.observableArrayList());
                  ListProperty<Object> listB = new SimpleListProperty<>(FXCollections.observableArrayList());

                  listB.bind(listA);

                  // when
                  listB.unbind();

                  // then
                  checker.setAsReferenced(listB);
                  checker.assertCollectable(listA);
              });
          }

            kcr Kevin Rushforth
            fkirmaier Florian Kirmaier
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: