Project: Eclipse_Platform_UI
Bug 217671 [Contributions] WorkbenchMenuService leaks editor after context menu opened
Reported: 2008-02-04 09:26:41 | Status: verified fixed

I20080204-0010, was OK in I20080129-1400 Our leak test org.eclipse.jdt.ui.tests.leaks.JavaLeakTest.testJavaEditorContextMenu() fails. Here's a trace that shows through which fields a CompilationUnitEditor is still referenced after this simple scenario: - open a CompilationUnitEditor - open context menu - close context menu - close editor junit.framework.AssertionFailedError: Expected: 0, actual: 1 Element 0 org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor org.eclipse.ui.internal.expressions.ActivePartExpression#activePart org.eclipse.ui.internal.menus.WorkbenchMenuService$ManagerPopulationRecord#restriction java.util.HashMap$Entry#value java.util.HashMap$Entry[3] java.util.HashMap#table org.eclipse.ui.internal.menus.WorkbenchMenuService#populatedManagers org.eclipse.ui.internal.menus.WorkbenchMenuService$1#this$0 org.eclipse.core.internal.registry.ExtensionRegistry$ListenerInfo#listener java.lang.Object[11] org.eclipse.core.runtime.ListenerList#listeners org.eclipse.core.internal.registry.ExtensionRegistry#listeners org.eclipse.osgi.framework.internal.core.ServiceRegistrationImpl#service java.lang.Object[31] java.util.ArrayList#elementData org.eclipse.osgi.framework.internal.core.ServiceRegistryImpl#allPublishedServices org.eclipse.osgi.framework.internal.core.Framework#serviceRegistry org.eclipse.osgi.framework.internal.core.AbstractBundle#framework org.eclipse.osgi.framework.internal.core.BundleLoader#bundle org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader#delegate org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader

Files changed in fix:
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/menus/WorkbenchMenuService.java