Skip to content

Commit 2267b11

Browse files
author
Jeanette Winzenburg
committed
8273071: SeparatorSkin: must remove child on dispose
Reviewed-by: arapte
1 parent e931501 commit 2267b11

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

modules/javafx.controls/src/main/java/javafx/scene/control/skin/SeparatorSkin.java

+7-4
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,11 @@
2626
package javafx.scene.control.skin;
2727

2828
import javafx.geometry.Orientation;
29-
import javafx.scene.Node;
30-
import javafx.scene.control.Accordion;
3129
import javafx.scene.control.Control;
3230
import javafx.scene.control.Separator;
3331
import javafx.scene.control.SkinBase;
3432
import javafx.scene.layout.Region;
3533

36-
import java.util.Collections;
37-
3834
/**
3935
* Default skin implementation for the {@link Separator} control.
4036
*
@@ -109,6 +105,13 @@ public SeparatorSkin(Separator control) {
109105
* *
110106
**************************************************************************/
111107

108+
109+
@Override
110+
public void dispose() {
111+
getChildren().remove(line);
112+
super.dispose();
113+
}
114+
112115
/**
113116
* We only need to deal with the single "line" child region. The important
114117
* thing here is that we want a horizontal separator to have a line which is

modules/javafx.controls/src/test/java/test/javafx/scene/control/skin/SkinMemoryLeakTest.java

-3
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@
5454
import javafx.scene.control.PasswordField;
5555
import javafx.scene.control.ScrollBar;
5656
import javafx.scene.control.ScrollPane;
57-
import javafx.scene.control.Separator;
5857
import javafx.scene.control.Skin;
5958
import javafx.scene.control.Spinner;
6059
import javafx.scene.control.SplitMenuButton;
@@ -141,8 +140,6 @@ public static Collection<Object[]> data() {
141140
PasswordField.class,
142141
ScrollBar.class,
143142
ScrollPane.class,
144-
// @Ignore("8273071")
145-
Separator.class,
146143
// @Ignore("8245145")
147144
Spinner.class,
148145
SplitMenuButton.class,

0 commit comments

Comments
 (0)