-
Bug
-
Resolution: Duplicate
-
P4
-
8
-
Win7 Java 8b106
Execute the test below - when the scrollpane is removed it's still referenced so it can't get GC'd.
public class ScrollPaneMemoryLeakTest extends Application
{
private MyScrollPane myPane;
public static void main(String[] args)
{
Application.launch(args);
}
@Override
public void start(Stage stage)
{
final FlowPane root = new FlowPane(10, 10);
myPane = new MyScrollPane();
root.getChildren().add(myPane);
Button b = new Button("Remove Pane");
b.setOnAction(new EventHandler<ActionEvent>()
{
@Override
public void handle(ActionEvent event)
{
root.getChildren().remove(myPane);
myPane = null;
}
});
root.getChildren().add(b);
Scene scene = new Scene(root, 800, 600);
stage.setScene(scene);
stage.show();
}
private static class MyScrollPane extends ScrollPane
{
}
}
public class ScrollPaneMemoryLeakTest extends Application
{
private MyScrollPane myPane;
public static void main(String[] args)
{
Application.launch(args);
}
@Override
public void start(Stage stage)
{
final FlowPane root = new FlowPane(10, 10);
myPane = new MyScrollPane();
root.getChildren().add(myPane);
Button b = new Button("Remove Pane");
b.setOnAction(new EventHandler<ActionEvent>()
{
@Override
public void handle(ActionEvent event)
{
root.getChildren().remove(myPane);
myPane = null;
}
});
root.getChildren().add(b);
Scene scene = new Scene(root, 800, 600);
stage.setScene(scene);
stage.show();
}
private static class MyScrollPane extends ScrollPane
{
}
}
- duplicates
-
JDK-8117458 Memory leak in CSS: ScrollPane is held strongly even after removal from scene graph
-
- Resolved
-