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

TabPane: Memory leak when switching skin

    Details

      Description

      just to keep track, a failing test below.

      Didn't dig, just verified that not/removing the listener to selectedItem in dispose (as suggested in fix for JDK-8241737) does not make a difference here.

          public static class TabPaneSkin1 extends TabPaneSkin {

              public TabPaneSkin1(TabPane control) {
                  super(control);
              }
              
          }
          
          /**
           * memory leak when replacing skin
           */
          @Test
          public void testTabPaneSkin() {
              TabPane control = new TabPane();
              ObservableList<String> data = FXCollections.observableArrayList("Apple", "Orange", "Banana");
              data.forEach(text -> control.getTabs().add(new Tab(text)));
              showControl(control);
              WeakReference<?> weakRef = new WeakReference<>(control.getSkin());
              control.setSkin(new TabPaneSkin1(control));
              attemptGC(weakRef, 10);
              assertNull("skin must be gc'ed", weakRef.get());
          }
       

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                arapte Ambarish Rapte
                Reporter:
                fastegal Jeanette Winzenburg
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated: