Project: SWT
Bug 283850 hang when calling BrowserFunction while disposing
Reported: 2009-07-17 09:50:46 | Status: resolved fixed

public class BrowserBug { public static void main(String[] args) { Display display = new Display(); Shell shell = new Shell(display); shell.setLayout(new GridLayout(1, false)); Browser browser = new Browser(shell, SWT.NONE); browser.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); browser.setText("<html><head></head><body><input type='text' onchange='bf(0)' /></body></html>"); new BrowserFunction(browser, "bf"){ public Object function(Object[] arguments) { System.out.println("hello"); return 0; } }; shell.pack(); shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) display.sleep(); } display.dispose(); } }

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