You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by GitBox <gi...@apache.org> on 2022/03/27 06:39:37 UTC

[GitHub] [netbeans] sdedic commented on a change in pull request #3875: Order Gradle sub-projects Nodes

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: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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