Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » CommandContributionItem is never disposed when it's placed at drop down menu from toolbar item.(CommandContributionItem is never disposed when it's placed at drop down menu from toolbar item.)
CommandContributionItem is never disposed when it's placed at drop down menu from toolbar item. [message #653023] Tue, 08 February 2011 02:58 Go to next message
Jeeeyul Lee is currently offline Jeeeyul Lee
Messages: 111
Registered: July 2009
Location: Seoul
Senior Member

<extension point="org.eclipse.ui.menus">


<menuContribution allPopups="false" locationURI="toolbar:test">
<command commandId="org.eclipse.ui.help.aboutAction" id="test-dropdown-menu-id" style="pulldown" />
</menuContribution>

<menuContribution allPopups="false" locationURI="menu:test-dropdown-menu-id">
<command commandId="org.eclipse.ui.help.quickStartAction" style="push" />
</menuContribution>

</extension>


1. I created Toolbar manager manually and give it "toobar:test" as location.
2. Put a command contribution into toolbar with drop down style, and give it some id to place another command on it.
3. Put a another command contribution into given menu id.
4. place breakpoint at CommandContribution#dispose()
5. dispose my toolbar. (closing view).
6. aboutAction was disposed but quickStartAction. (red)


Command Contribution retains handler service and execution context which refers active editor and selection.
It causes huge leak problems.


What did I do wrong?

Thanks for reading.


Addition:
CommandContiributionItem#openDropDownMenu() seems to reason.
There is no releasing or disposing for menu manager.

[Updated on: Tue, 08 February 2011 04:04]

Report message to a moderator

Re: CommandContributionItem is never disposed when it's placed at drop down menu from toolbar item. [message #653030 is a reply to message #653023] Tue, 08 February 2011 04:33 Go to previous messageGo to next message
Jeeeyul Lee is currently offline Jeeeyul Lee
Messages: 111
Registered: July 2009
Location: Seoul
Senior Member

Now I'm sure this is a bug.

CommandContributionItem#openDropDownMenu() must release menu manager from workbench menu service when IMenuListener2#menuAboutToHide() is call.
Re: CommandContributionItem is never disposed when it's placed at drop down menu from toolbar item. [message #653094 is a reply to message #653030] Tue, 08 February 2011 13:19 Go to previous message
Paul Webster is currently offline Paul Webster
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

On 02/07/2011 11:33 PM, Jiyul wrote:
> Now I'm sure this is a bug.
>
> CommandContributionItem#openDropDownMenu() must release menu manager
> from workbench menu service when IMenuListener2#menuAboutToHide() is call.

That definitely sounds like a bug. The CCI either needs to release the
contributions for the MenuManager after each open, or save that
MenuManager so that it can be released/disposed properly.

https://bugs.eclipse.org/bugs/show_bug.cgi?id=336584

PW

--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Platform_Expression_Framework
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .platform.doc.isv/guide/workbench.htm


Previous Topic:Confusing error messages relating to plug-in dependencies
Next Topic:How To set Dataformat for DateTime widget
Goto Forum:
  


Current Time: Sat Nov 01 12:01:31 GMT 2014

Powered by FUDForum. Page generated in 0.07728 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software