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.
public void destroy() throws IOException { // cleanup globalSingleton.removeListener(this); // let framework do his work super.destroy(); } is not called by Children.Keys if it gets new set of keys causing given node to disappear.
It can cause serious leaks. As workaround Node can attach to event sources using weak listeners.
raising priority - leak is serious problem, it must be fixed for NB3.6
Of course. destroy is used for deleting nodes, not for no-longer-visible notification. e.g. DataNode.destroy deletes files....
Javadoc suggests to place cleanup code here. Also deleting from parent links to deleting from parent's children (defining Node lifetime). You desribed current behaviour which is probably faulty.
See also BeanNode destroy in openide.
Then I'd have to call destroy even in case the node is no longer visible and I really don't want my IDE to delete my files just because I've closed the explorer. Current behaviour may be faulty in your eyes buy it has 5+ years of precedent behaviour and we can't fix all the DataNode subclasses. Also, what would DeleteAction call? Try listnening for nodeDestroyed event instead, although I don't agree much that it should be fired when nodes go away (and it works only for Children.Keys subclasses)
NodeListener.nodeDesroyed is called properly (for children.keys). Consider similar callback as requirement for upcoming Nodes redesign.
Reassigning to new module owner Tomas Holy.
Use Children.Keys.destroyNodes().