Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8236259: MemoryLeak in ProgressIndicator #71

Closed
wants to merge 7 commits into from
@@ -2511,7 +2511,6 @@ project(":controls") {
testCompile project(":base").sourceSets.test.output
compile project(':base')
compile project(':graphics')
testCompile "de.sandec:JMemoryBuddy:0.1.3"
}

test {
@@ -27,20 +27,16 @@

import static org.junit.Assert.assertEquals;

import de.sandec.jmemorybuddy.JMemoryBuddy;
import javafx.beans.value.ObservableValue;
import javafx.scene.Node;
import javafx.scene.control.ProgressIndicator;
import javafx.scene.Group;
import javafx.scene.layout.StackPane;
import javafx.scene.paint.Color;
import javafx.scene.Scene;
import javafx.scene.control.skin.ProgressIndicatorSkin;
import javafx.scene.control.skin.ProgressIndicatorSkinShim;
import javafx.scene.paint.Paint;
import javafx.stage.Stage;

import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;

@@ -87,28 +83,4 @@ public Paint getProgressColor() {
return ProgressIndicatorSkinShim.getProgressColor(this);
}
}


@Test
public void memoryTest() {
ProgressIndicator indicator = new ProgressIndicator(-1);
JMemoryBuddy.memoryTest((checker) -> {
indicator.setSkin(new ProgressIndicatorSkin(indicator));
Scene scene = new Scene(indicator);
Stage stage = new Stage();
stage.setScene(scene);
stage.show();

indicator.setProgress(1.0);
Assert.assertTrue("size was: " + indicator.getChildrenUnmodifiable().size(), indicator.getChildrenUnmodifiable().size() == 1);

Node detIndicator = indicator.getChildrenUnmodifiable().get(0);
System.out.println(detIndicator.getClass().getSimpleName());
checker.assertCollectable(detIndicator);
indicator.setProgress(-1.0);
indicator.setProgress(1.0);

indicator.test_getRemoved().clear();
});
}
}
@@ -1926,7 +1926,7 @@ void releaseAccessible() {
/**
* Note: The only user of this method is in unit test: Parent_structure_sync_Test.
*/
public List<Node> test_getRemoved() {
List<Node> test_getRemoved() {
return removed;
}

ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.