-
Bug
-
Resolution: Fixed
-
P4
-
jfx14
happens if it has a graphic. The misbehavior is
- memory leak
- NPE (after removing incorrect guard against null in the listener ;) on resize the graphic
culprit is a listener added to the graphic's layoutBounds:
final InvalidationListener graphicPropertyChangedListener = valueModel -> {
invalidText = true;
// fixme: this must not be called after dispose
/*if (getSkinnable() != null)*/
getSkinnable().requestLayout();
};
to reproduce the memory leak, add a Label (and all other subclasses) with graphic to the list of controls in SkinMemoryLeakTest. For the NPE, add a test like:
/**
* Cleanup graphic listener -
*/
@Test
public void testLabeledGraphicDispose() {
Rectangle graphic = (Rectangle) control.getGraphic();
installDefaultSkin(control);
control.getSkin().dispose();
graphic.setWidth(500);
}
to fix, remove the listener in dispose
- memory leak
- NPE (after removing incorrect guard against null in the listener ;) on resize the graphic
culprit is a listener added to the graphic's layoutBounds:
final InvalidationListener graphicPropertyChangedListener = valueModel -> {
invalidText = true;
// fixme: this must not be called after dispose
/*if (getSkinnable() != null)*/
getSkinnable().requestLayout();
};
to reproduce the memory leak, add a Label (and all other subclasses) with graphic to the list of controls in SkinMemoryLeakTest. For the NPE, add a test like:
/**
* Cleanup graphic listener -
*/
@Test
public void testLabeledGraphicDispose() {
Rectangle graphic = (Rectangle) control.getGraphic();
installDefaultSkin(control);
control.getSkin().dispose();
graphic.setWidth(500);
}
to fix, remove the listener in dispose
- blocks
-
JDK-8241364 ☂ Cleanup skin implementations to allow switching
- Open
- relates to
-
JDK-8293606 Labeled: memory leak when moving the graphic to another parent
- Open