- There should be no need to create a public dispose method and shift the responsibility of disposing the listener to the user of the FileSystemView class.
You can simply convert the PropertyChangeListener to a so-called weak listener, and keep this PropertyChangeListener an implementation detail (see the WeakChangeListener in javafx.beans.value package for an example of what I mean with a weak listener, or http://www.jroller.com/santhosh/entry/use_weak_listeners_to_avoid). - The javadoc of that new dispose method is unclear. How do you suppose somebody somebody will know what "the PropertyChangeListener" is. This remark of course becomes irrelevant if you remove that method from the public API. Robin On Tue, Jul 4, 2017 at 11:40 AM, Prasanta Sadhukhan < [email protected]> wrote: > Hi All, > > Please review a fix for a memory leak issue where PropertyChangeListener > object added by FileSystemView constructor is never removed. > Proposed fix is to add dispose() method to be called by app when they want > to remove this resource. > > Bug: https://bugs.openjdk.java.net/browse/JDK-8175968 > webrev: http://cr.openjdk.java.net/~psadhukhan/8175968/webrev.00/ > > Regards > Prasanta >
