Project: JDT
Bug 175534 ScrolledPageContent leaks three colors
Reported: 2007-02-26 10:24:42 | Status: verified fixed

Build: I20070220 1) Capture Sleak snapshot 2) File > New > Project 3) Select Java project, click Next 4) Hit Esc to close dialog 5) Capture Sleak diff Three colors are leaked each time the Java project wizard is opened. Two copies of the "form title color", and one copy of the form background color. These all originate from use of FormColors class without calling FormColors.dispose. Sample Sleak output: va.lang.Error at java.lang.Throwable.<init>(Throwable.java:58) at org.eclipse.swt.graphics.Device.new_Object(Device.java:786) at org.eclipse.swt.graphics.Color.<init>(Color.java:80) at org.eclipse.ui.forms.FormColors.createColor(FormColors.java:257) at org.eclipse.ui.forms.FormColors.createColor(FormColors.java:213) at org.eclipse.ui.forms.FormColors.createTitleColor(FormColors.java:524) at org.eclipse.ui.forms.FormColors.initializeColorTable(FormColors.java:148) at org.eclipse.ui.forms.FormColors.initialize(FormColors.java:138) at org.eclipse.ui.forms.FormColors.<init>(FormColors.java:116) at org.eclipse.jdt.internal.ui.preferences.ScrolledPageContent.<init>(ScrolledPageContent.java:35) at org.eclipse.jdt.internal.ui.preferences.ScrolledPageContent.<init>(ScrolledPageContent.java:27) at org.eclipse.jdt.internal.ui.wizards.buildpaths.newsourcepage.NewSourceContainerWorkbookPage.getControl(NewSourceContainerWorkbookPage.java:180) at org.eclipse.jdt.internal.ui.wizards.buildpaths.BuildPathsBlock.createControl(BuildPathsBlock.java:232) at org.eclipse.jdt.ui.wizards.JavaCapabilityConfigurationPage.createControl(JavaCapabilityConfigurationPage.java:156) at org.eclipse.jface.wizard.Wizard.createPageControls(Wizard.java:259) at org.eclipse.jface.wizard.WizardDialog.createPageControls(WizardDialog.java:629) at org.eclipse.jface.wizard.WizardDialog.setWizard(WizardDialog.java:1028) at org.eclipse.jface.wizard.WizardDialog.updateForPage(WizardDialog.java:1080) at org.eclipse.jface.wizard.WizardDialog.access$2(WizardDialog.java:1077) at org.eclipse.jface.wizard.WizardDialog$4.run(WizardDialog.java:1067) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:67) at org.eclipse.jface.wizard.WizardDialog.showPage(WizardDialog.java:1065) at org.eclipse.ui.internal.dialogs.NewWizardSelectionPage.advanceToNextPageOrFinish(NewWizardSelectionPage.java:71) at org.eclipse.ui.internal.dialogs.NewWizardNewPage$1.doubleClick(NewWizardNewPage.java:355) at org.eclipse.jface.viewers.StructuredViewer$1.run(StructuredViewer.java:798) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37) at org.eclipse.core.runtime.Platform.run(Platform.java:850) at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:52) at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:153) at org.eclipse.jface.viewers.StructuredViewer.fireDoubleClick(StructuredViewer.java:796) at org.eclipse.jface.viewers.AbstractTreeViewer.handleDoubleSelect(AbstractTreeViewer.java:1347) at org.eclipse.jface.viewers.StructuredViewer$4.widgetDefaultSelected(StructuredViewer.java:1167) at org.eclipse.jface.util.OpenStrategy.fireDefaultSelectionEvent(OpenStrategy.java:237) at org.eclipse.jface.util.OpenStrategy.access$0(OpenStrategy.java:234) at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:295) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3507) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3121) at org.eclipse.jface.window.Window.runEventLoop(Window.java:820) at org.eclipse.jface.window.Window.open(Window.java:796) at org.eclipse.ui.actions.NewProjectAction.run(NewProjectAction.java:116) at org.eclipse.jface.action.Action.runWithEvent(Action.java:498) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:545) at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:490) at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:402) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3507) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3121) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2286) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2250) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2125) at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:459) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:289) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:454) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:101) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:146) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:106) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:76) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:354) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:169) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:85) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:58) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:60) at java.lang.reflect.Method.invoke(Method.java:391) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:476) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:416) at org.eclipse.equinox.launcher.Main.run(Main.java:1124) at org.eclipse.equinox.launcher.Main.main(Main.java:1099)

Files changed in fix:
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/ScrolledPageContent.java