aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephan Wahlbrink2012-01-23 11:14:39 (EST)
committerPaul Webster2012-01-23 11:15:01 (EST)
commit108533e60a824e0a68b426bb3367a8aa5de2a788 (patch)
tree21f7a621b96e0ab1c15c26aef9808f9e66c2d2fd
parentd38125761e5d351338944702ab0297b8aadaf9e5 (diff)
downloadeclipse.platform.ui-108533e60a824e0a68b426bb3367a8aa5de2a788.zip
eclipse.platform.ui-108533e60a824e0a68b426bb3367a8aa5de2a788.tar.gz
eclipse.platform.ui-108533e60a824e0a68b426bb3367a8aa5de2a788.tar.bz2
Bug 336584 - [Contributions] CommandContributionItem#openDropDownMenu()
never release menu manager Release it in an asyncExec
-rw-r--r--bundles/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 669554a..1ddf6f1 100644
--- 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;
@@ -867,7 +867,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) {
@@ -876,6 +876,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