changeset 8891:28006a7446da 8u60-b08

RT-40308: Memory Leak issue with Charts / WeakReferences / Platform.accessibilityActiveProperty()
author jgiles
date Mon, 23 Mar 2015 10:42:00 +1300
parents 97bfddda92fd
children 5a7451f667fc bf72a4332ccd 62c6eba89ef7
files modules/controls/src/main/java/javafx/scene/chart/AreaChart.java modules/controls/src/main/java/javafx/scene/chart/BarChart.java modules/controls/src/main/java/javafx/scene/chart/LineChart.java modules/controls/src/main/java/javafx/scene/chart/ScatterChart.java modules/controls/src/main/java/javafx/scene/chart/StackedAreaChart.java modules/controls/src/main/java/javafx/scene/chart/StackedBarChart.java
diffstat 6 files changed, 30 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/modules/controls/src/main/java/javafx/scene/chart/AreaChart.java	Sun Mar 22 12:09:48 2015 -0700
+++ b/modules/controls/src/main/java/javafx/scene/chart/AreaChart.java	Mon Mar 23 10:42:00 2015 +1300
@@ -250,6 +250,11 @@
 
     @Override protected  void dataItemRemoved(final Data<X,Y> item, final Series<X,Y> series) {
         final Node symbol = item.getNode();
+
+        if (symbol != null) {
+            symbol.focusTraversableProperty().unbind();
+        }
+
         // remove item from sorted list
         int itemIndex = series.getItemIndex(item);
         if (shouldAnimate()) {
--- a/modules/controls/src/main/java/javafx/scene/chart/BarChart.java	Sun Mar 22 12:09:48 2015 -0700
+++ b/modules/controls/src/main/java/javafx/scene/chart/BarChart.java	Mon Mar 23 10:42:00 2015 +1300
@@ -226,6 +226,11 @@
 
     @Override protected void dataItemRemoved(final Data<X,Y> item, final Series<X,Y> series) {
         final Node bar = item.getNode();
+
+        if (bar != null) {
+            bar.focusTraversableProperty().unbind();
+        }
+
         if (shouldAnimate()) {
             XYValueMap.clear();
             dataRemoveTimeline = createDataRemoveTimeline(item, bar, series);
--- a/modules/controls/src/main/java/javafx/scene/chart/LineChart.java	Sun Mar 22 12:09:48 2015 -0700
+++ b/modules/controls/src/main/java/javafx/scene/chart/LineChart.java	Mon Mar 23 10:42:00 2015 +1300
@@ -294,6 +294,11 @@
 
     @Override protected  void dataItemRemoved(final Data<X,Y> item, final Series<X,Y> series) {
         final Node symbol = item.getNode();
+
+        if (symbol != null) {
+            symbol.focusTraversableProperty().unbind();
+        }
+
         // remove item from sorted list
         int itemIndex = series.getItemIndex(item);
         if (shouldAnimate()) {
--- a/modules/controls/src/main/java/javafx/scene/chart/ScatterChart.java	Sun Mar 22 12:09:48 2015 -0700
+++ b/modules/controls/src/main/java/javafx/scene/chart/ScatterChart.java	Mon Mar 23 10:42:00 2015 +1300
@@ -107,6 +107,11 @@
     /** @inheritDoc */
     @Override protected  void dataItemRemoved(final Data<X,Y> item, final Series<X,Y> series) {
         final Node symbol = item.getNode();
+
+        if (symbol != null) {
+            symbol.focusTraversableProperty().unbind();
+        }
+
         if (shouldAnimate()) {
             // fade out old symbol
             FadeTransition ft = new FadeTransition(Duration.millis(500),symbol);
--- a/modules/controls/src/main/java/javafx/scene/chart/StackedAreaChart.java	Sun Mar 22 12:09:48 2015 -0700
+++ b/modules/controls/src/main/java/javafx/scene/chart/StackedAreaChart.java	Mon Mar 23 10:42:00 2015 +1300
@@ -235,6 +235,11 @@
 
     @Override protected  void dataItemRemoved(final Data<X,Y> item, final Series<X,Y> series) {
         final Node symbol = item.getNode();
+
+        if (symbol != null) {
+            symbol.focusTraversableProperty().unbind();
+        }
+
         // remove item from sorted list
         int itemIndex = series.getItemIndex(item);
         if (shouldAnimate()) {
--- a/modules/controls/src/main/java/javafx/scene/chart/StackedBarChart.java	Sun Mar 22 12:09:48 2015 -0700
+++ b/modules/controls/src/main/java/javafx/scene/chart/StackedBarChart.java	Mon Mar 23 10:42:00 2015 +1300
@@ -220,6 +220,11 @@
 
     @Override protected void dataItemRemoved(final Data<X, Y> item, final Series<X, Y> series) {
         final Node bar = item.getNode();
+
+        if (bar != null) {
+            bar.focusTraversableProperty().unbind();
+        }
+
         if (shouldAnimate()) {
             Timeline t = createDataRemoveTimeline(item, bar, series);
             t.setOnFinished(event -> {