Bug 391270

Summary: Vestigial CommandContributionItems
Product: [Eclipse Project] Platform Reporter: Karen Butzke <karenfbutzke>
Component: UIAssignee: Platform-UI-Inbox <Platform-UI-Inbox>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert, nobody, rolf.theunissen
Version: 4.2.1Keywords: performance
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on:    
Bug Blocks: 390379    

Description Karen Butzke CLA 2012-10-05 16:16:25 EDT
Still reviewing the fix for bug 389335 (unsuccessful with bug 391255 :))

In the ShowViewMenu.fill method Oleg added a call to dispose the menuManager before filling it again. So, now we are left with vestigial CommandContributionItems. I'm calling them vestigial because they won't ever be used again, but they aren't disposed of immediately after the menu is shown thus they still have listeners.I think the ShowViewMenu should be "emptied" during the MenuManager.handleAboutToHide vs being emptied during the handleAboutToShow.

Now when I go to do something like Select the Package Explorer and then use ctrl-shift-T to get to the 'Open Type' dialog I see all those vestigial CommandContributionItems get updated because they are BindingManagerListeners.

The same type of problem exists with the right-click popup menu in the Egit History view and maybe some other egit view popup menus.
Comment 1 Paul Webster CLA 2012-10-10 10:15:56 EDT
(In reply to comment #0)
> In the ShowViewMenu.fill method Oleg added a call to dispose the menuManager
> before filling it again. So, now we are left with vestigial
> CommandContributionItems. I'm calling them vestigial because they won't ever
> be used again, but they aren't disposed of immediately after the menu is
> shown thus they still have listeners.I think the ShowViewMenu should be
> "emptied" during the MenuManager.handleAboutToHide vs being emptied during
> the handleAboutToShow.

It's a fundamental issue with our use of popups, that the menu manager isn't cleared until the next popup.

But they can't be cleared in the SWT.hide event, that wipes out the widgets before the SWT.Selection event on the menu item is processed.

PW
Comment 2 Lars Vogel CLA 2019-11-27 07:47:34 EST
This bug hasn't had any activity in quite some time. Maybe the problem got
resolved, was a duplicate of something else, or became less pressing for some
reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it.
The information can be, for example, that the problem still occurs, that you
still want the feature, that more information is needed, or that the bug is
(for whatever reason) no longer relevant.

If the bug is still relevant, please remove the stalebug whiteboard tag.
Comment 3 Rolf Theunissen CLA 2019-12-22 06:29:16 EST
If I am correct, the cleaning of the menu can be scheduled on hide. See org.eclipse.ui.internal.PopupMenuExtender.menuAboutToHide(IMenuManager)