Community
Participate
Working Groups
build I20040318 While investigating a leak of Java editors (bug 53473), we found that the JavaOutlinePage's CustomFiltersActionGroup hooks a menu listener on the menu manager of the page site's action bars. This is a SubMenuManager. Its implementation of addMenuListener simply delegates to the parent. There are two problems here: 1. These menu listeners are not disposed when the action bars are disposed. 2. When the menu is shown, the listener is given the parent menu manager to add to, not the sub menu manager.
Adding Doug, FYI.
Note that CustomFiltersActionGroup.dispose() tries to remove their menu listener, but this dispose is never called. This is a problem in JDT, for which Chris is entering a separate PR. But even if they didn't explicitly remove the listener, SubActionBars should take care of it.
Added SubContributionManager.disposeManager(), which does removeAll(). Changed SubMenuManager to properly virtualize menu listeners, and remove the parent listener in disposeManager(). Changed SubActionBars.dispose() to call disposeManager() on its managers instead of removeAll(). Fixed PageSite.dispose() to call subActionBars.dispose(). Should look for other creators of SubActionBars and ensure they call dispose.
Found only one case, in the PDE editors: bug 55599.
bug 55604 tracks the JDT case.