This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
I did several times Clean And Build on a project. When I closed the output window with the ant output using its popup (its Close item), there were several instances of objects from o.n.core.output2 package left in memory (see the first screenshot below). You can see in the reference path of OutputTab (see the second screenshot) that it is kept in memory through the popup menu...
Created attachment 16783 [details] List of leaking objects
Created attachment 16784 [details] 4 leaked instances of OutputTab
Now removes all items from the popup menu when it's hidden, and sets its invoker to null. Checking in src/org/netbeans/core/output2/Controller.java; /cvs/core/output2/src/org/netbeans/core/output2/Controller.java,v <-- Controller.java new revision: 1.11; previous revision: 1.10 done
Still leaking, through listener. See the following attachment.
Created attachment 16835 [details] Detail of leaked OutputTab
Okay, I now null out the client properties used in the menu as well - let me know if there's still another path for it to leak. Checking in Controller.java; /cvs/core/output2/src/org/netbeans/core/output2/Controller.java,v <-- Controller.java new revision: 1.15; previous revision: 1.14 done
Sorry, Tim, I still see one thing leaking, instances of o.n.c.output2.Controller$PMListener. See the attached screenshots.
Created attachment 16858 [details] PMListener instance 1
Created attachment 16859 [details] PMListener instance 2
Okay, the listener now removes itself too. Checking in Controller.java; /cvs/core/output2/src/org/netbeans/core/output2/Controller.java,v <-- Controller.java new revision: 1.16; previous revision: 1.15 done I predict that next you'll ask that I iterate all of the menu items and cause themselves to remove themselves as listeners on the array of Actions, which Controller holds...am I right?
Exactly... ;o)
Okay, listeners are cleared whenever the popup is hidden now. Checking in Controller.java; /cvs/core/output2/src/org/netbeans/core/output2/Controller.java,v <-- Controller.java new revision: 1.17; previous revision: 1.16 done
x
Verified.