Project: SWT
Bug 134417 Browser Cannot Be Disposed (Intel Carbon SWT)
Reported: 2006-04-02 13:21:24 | Status: resolved fixed

The following Snippet works under 3.1 (with universal SWT), but not under 3.2M5 and 3.2M6. My computer is an Intel iMac. public static void main(String [] args) { String html = "<HTML><HEAD><TITLE>HTML Test</TITLE></HEAD><BODY>"; for (int i = 0; i < 20; i++) html += "<P>This is line "+i+"</P>"; html += "</BODY></HTML>"; Display display = new Display(); Shell shell = new Shell(display); shell.setLayout(new FillLayout()); Browser browser = new Browser(shell, SWT.NONE); browser.setText(html); shell.open(); // Here: Browser can't be disposed, one does not see the label afterwards (on >=3.2M5) browser.dispose(); System.out.println("Browser is disposed: "+browser.isDisposed()); Label label = new Label(shell, SWT.NONE); label.setText("This is the label"); shell.layout(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) display.sleep(); } display.dispose(); }

Files changed in fix:
bundles/org.eclipse.swt/Eclipse SWT Browser/carbon/org/eclipse/swt/browser/Browser.java