aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephan Wahlbrink2012-01-23 11:14:39 (EST)
committerPaul Webster2012-01-23 11:16:45 (EST)
commite7d1c5906a64713b4c9eca702d367672fb31c920 (patch)
tree28577ddc1cd3b02dd002badd7496cf030b0b0a3f
parent9ab6c6b5d0837b2e28be0e4f001ae1aafe3320c2 (diff)
downloadeclipse.platform.ui-e7d1c5906a64713b4c9eca702d367672fb31c920.zip
eclipse.platform.ui-e7d1c5906a64713b4c9eca702d367672fb31c920.tar.gz
eclipse.platform.ui-e7d1c5906a64713b4c9eca702d367672fb31c920.tar.bz2
Bug 336584 - [Contributions] CommandContributionItem#openDropDownMenu()
never release menu manager Release it in an asyncExec
-rwxr-xr-xbundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/menus/CommandContributionItem.java12
1 files changed, 10 insertions, 2 deletions
diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/menus/CommandContributionItem.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/menus/CommandContributionItem.java
index 6d23bb1..d5c898e 100755
--- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/menus/CommandContributionItem.java
+++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/menus/CommandContributionItem.java
@@ -24,7 +24,7 @@ import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.action.ContributionItem;
import org.eclipse.jface.action.IContributionManager;
-import org.eclipse.jface.action.IMenuListener;
+import org.eclipse.jface.action.IMenuListener2;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.bindings.BindingManagerEvent;
@@ -872,7 +872,7 @@ public class CommandContributionItem extends ContributionItem {
if (workbenchHelpSystem != null) {
workbenchHelpSystem.setHelp(menu, helpContextId);
}
- menuManager.addMenuListener(new IMenuListener() {
+ menuManager.addMenuListener(new IMenuListener2() {
public void menuAboutToShow(IMenuManager manager) {
String id = getId();
if (dropDownMenuOverride != null) {
@@ -881,6 +881,14 @@ public class CommandContributionItem extends ContributionItem {
menuService.populateContributionManager(
menuManager, "menu:" + id); //$NON-NLS-1$
}
+ public void menuAboutToHide(IMenuManager manager) {
+ display.asyncExec(new Runnable() {
+ public void run() {
+ menuService.releaseContributions(menuManager);
+ menuManager.dispose();
+ }
+ });
+ }
});
// position the menu below the drop down item