Bug 62097 [Perspectives] Toolbar MenuDetect listeners leaking
When I reset perspective we are leaking ToolBarContributionItem MenuDetect Listeners. STEPS 1) Look at workbench with Optimize It 2) Reset perspective 3) 10 menu detect listeners on items will be left around. Toolbars are not being leaked and we create this listener in ToolBarContributionItem fill(Coolbar,int) using an inner class that we have no reference too. The reference graphs indicates that the Display still has the listener in the event table
bundles/org.eclipse.jface/src/org/eclipse/jface/action/ToolBarContributionItem.java
*      int)
     */
    public void fill(CoolBar coolBar, int index) {
        if (checkDisposed()) {
            return;
        }
        if (coolItem == null && coolBar != null) {
            ToolBar oldToolBar = toolBarManager.getControl();
            ToolBar toolBar = toolBarManager.createControl(coolBar);
            if ((oldToolBar != null) && (oldToolBar.equals(toolBar))) {
                
                toolBarManager.update(true);
            }
            
            if (toolBar.getItemCount() < 1)
                return;
            int flags = SWT.DROP_DOWN;
            if (index >= 0) {
                coolItem = new CoolItem(coolBar, flags, index);
            } else {
                coolItem = new CoolItem(coolBar, flags);
            }
            
            coolItem.setData(this);
            
            coolItem.setControl(toolBar);
            
            toolBar.addListener(SWT.MenuDetect, new Listener() {
                public void handleEvent(Event event) {