sdedic commented on a change in pull request #3875:
URL: https://github.com/apache/netbeans/pull/3875#discussion_r835859063



##########
File path: 
extide/gradle/src/org/netbeans/modules/gradle/nodes/SubProjectsNode.java
##########
@@ -108,26 +113,39 @@ public Image getOpenedIcon(int type) {
     private static class SubProjectsChildFactory extends ChildFactory<Project> 
{
 
         private final Project project;
-        private final PropertyChangeListener listener;
+        private final PropertyChangeListener propListener;
+        private final PreferenceChangeListener prefListener;
 
         SubProjectsChildFactory(Project proj) {
             project = proj;
-            listener = (PropertyChangeEvent evt) -> {
+            propListener = (PropertyChangeEvent evt) -> {
                 if 
(NbGradleProject.PROP_PROJECT_INFO.equals(evt.getPropertyName())) {
                     ProjectManager.getDefault().clearNonProjectCache();
                     refresh(false);
                 }
             };
-            NbGradleProject.addPropertyChangeListener(project, listener);
+            NbGradleProject.addPropertyChangeListener(project, 
WeakListeners.propertyChange(propListener, proj));

Review comment:
       good catch ! Allows the nodes to GC.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to