-
Notifications
You must be signed in to change notification settings - Fork 504
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
8227619: Potential memory leak in javafx.scene.control.ListView #84
Conversation
👋 Welcome back arapte! A progress list of the required criteria for merging this PR into |
/reviewers 2 |
@kevinrushforth |
Presuming that using a weak reference causes no other issues, the fix looks fine and will resolve the leak. How confident are you that there are no cases where the listener might be prematurely garbage collected? |
The listener is added by |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, this makes sense. Somewhat related to this, I see that ListViewBitSetSelectionModel
is using a WeakInvalidationListener
in order to avoid a similar problem.
@arapte This change now passes all automated pre-integration checks. When the change also fulfills all project specific requirements, type
Since the source branch of this PR was last updated there have been 46 commits pushed to the ➡️ To integrate this PR with the above commit message, type |
/integrate |
@arapte The following commits have been pushed to master since your change was applied:
Your commit was automatically rebased without conflicts. Pushed as commit e986459. |
Mailing list message from Ambarish Rapte on openjfx-dev: Changeset: e986459 8227619: Potential memory leak in javafx.scene.control.ListView Reviewed-by: kcr, aghaisas ! modules/javafx.controls/src/main/java/com/sun/javafx/scene/control/SelectedItemsReadOnlyObservableList.java |
ListView
does not get GCed becauseSelectedItemsReadOnlyObservableList
adds aListChangeListener
to the (ObservableList
) items ofListView
.Adding a
WeakListChangeListener
instead ofListChangeListener
fixes the issue.Added a unit test and verified that existing tests do not fail due to this change.
Progress
Issue
JDK-8227619: Potential memory leak in javafx.scene.control.ListView
Approvers