Bug 275627 [Forms] Leak: BusyIndicator must ensure to properly dispose created images on disposal
Build ID: M20090211-1700 Steps To Reproduce: 1. Use a SharedHeaderFormEditor and setBusy(true) when setting an input 2. Close the editor while busy is still set to true Actual results: The 8 progress images (spinning wheel) created by BusyIndicator are only disposed in clearImages() when the busyThread is NULL, however its only set to true if explicitly disposed or setBusy(false) is called. Proposed solution: Ensure to dispose alles images from the imageCache as soon as the canvas (BusyIndicator's parent class) is disposed. Is there anything we can do to work around this problem? I tried to call "getHeaderForm().getForm().setBusy(false)" from the dispose method of SharedHeaderFormEditor however this seems a little risky because it may trigger a layout of the header area and I am not sure what the impact is when this happens during dispose.
bundles/org.eclipse.ui.forms/src/org/eclipse/ui/internal/forms/widgets/BusyIndicator.java
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.PaintEvent;
import org.eclipse.swt.events.PaintListener;
import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.ImageData;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.widgets.Canvas;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.osgi.framework.Bundle;
public final class BusyIndicator extends Canvas {
	class BusyThread extends Thread {
		Rectangle bounds;
		Display display;
		GC offScreenImageGC;
		Image offScreenImage;
		Image timage;
		boolean stop;
		
		private BusyThread(Rectangle bounds, Display display, GC offScreenImageGC, Image offScreenImage) {
			this.bounds = bounds;
			this.display = display;
			this.offScreenImageGC = offScreenImageGC;
			this.offScreenImage = offScreenImage;
		}