Project: Eclipse_Platform_UI
Bug 252497 [WorkingSets] Image leak in Project Explorer context menu
Reported: 2008-10-28 16:44:40 | Status: verified fixed

Each time I open the view dropdown menu in the Project Explorer view, the icons for the working set menu contribution items are leaked. I.e., I have three working sets, so each time I open the menu three images are leaked. Here is a stack trace of the image allocation from Sleak: java.lang.Error at org.eclipse.swt.graphics.Device.new_Object(Device.java:806) at org.eclipse.swt.graphics.Resource.init(Resource.java:85) at org.eclipse.swt.graphics.Image.<init>(Image.java:577) at org.eclipse.jface.resource.URLImageDescriptor.createImage(URLImageDescriptor.java:162) at org.eclipse.jface.resource.ImageDescriptor.createImage(ImageDescriptor.java:227) at org.eclipse.jface.resource.ImageDescriptor.createImage(ImageDescriptor.java:205) at org.eclipse.ui.internal.WorkingSetMenuContributionItem.fill(WorkingSetMenuContributionItem.java:89) at org.eclipse.jface.action.MenuManager.doItemFill(MenuManager.java:731) at org.eclipse.jface.action.MenuManager.update(MenuManager.java:812) at org.eclipse.ui.internal.ViewPane$PaneMenuManager.update(ViewPane.java:97) at org.eclipse.jface.action.MenuManager.handleAboutToShow(MenuManager.java:464) at org.eclipse.jface.action.MenuManager.access$1(MenuManager.java:459) at org.eclipse.jface.action.MenuManager$2.menuShown(MenuManager.java:485) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:235) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1027) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1008) at org.eclipse.swt.widgets.Control.WM_INITMENUPOPUP(Control.java:4120) at org.eclipse.swt.widgets.Control.windowProc(Control.java:3824) at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:342) at org.eclipse.swt.widgets.Decorations.windowProc(Decorations.java:1576) at org.eclipse.swt.widgets.Shell.windowProc(Shell.java:1937) at org.eclipse.swt.widgets.Display.windowProc(Display.java:4557) at org.eclipse.swt.internal.win32.OS.TrackPopupMenu(Native Method) at org.eclipse.swt.widgets.Menu._setVisible(Menu.java:250) at org.eclipse.swt.widgets.Display.runPopups(Display.java:3874) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3440) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2382) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2198) at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:333) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:488) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:193) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:370) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:615) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:549) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504) at org.eclipse.equinox.launcher.Main.run(Main.java:1236)

Files changed in fix:
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/actions/WorkingSetFilterActionGroup.java