Bug 242466 [JFace] Widget is disposed error when closing dialog from OSX dock
- run the snippet below which shows a dialog - right-click its icon in the OSX dock and select Quit -> the exception at the bottom will be spewed - it looks like the last line of Window.runEventLoop(Shell) should change from: display.update(); to... if (!display.isDisposed()) display.update(); snippet: public static void main (String [] args) { try { final Display display = new Display (); final Shell shell = new Shell (display); TitleAreaDialog dialog = new TitleAreaDialog(shell); dialog.setBlockOnOpen(true); dialog.open(); display.dispose (); } catch (Exception e) { e.printStackTrace(); } } exception: org.eclipse.swt.SWTException: Widget is disposed at org.eclipse.swt.SWT.error(SWT.java:3777) at org.eclipse.swt.SWT.error(SWT.java:3695) at org.eclipse.swt.SWT.error(SWT.java:3666) at org.eclipse.swt.widgets.Display.error(Display.java:1126) at org.eclipse.swt.widgets.Display.checkDevice(Display.java:626) at org.eclipse.swt.widgets.Display.update(Display.java:4084) at org.eclipse.jface.window.Window.runEventLoop(Window.java:832) at org.eclipse.jface.window.Window.open(Window.java:801) at win32.Main1.main(Main1.java:20)
bundles/org.eclipse.jface/src/org/eclipse/jface/window/Window.java
* disposed (i.e., closed) before this method can be called.
     * 
     * @param newParentShell
     *            The new parent shell; this value may be <code>null</code> if
     *            there is to be no parent.
     * @since 3.1
     */
    protected void setParentShell(final Shell newParentShell) {
        Assert.isTrue((shell == null), "There must not be an existing shell."); 
        parentShell = new SameShellProvider(newParentShell);
    }
	/**
	 * Sets this window's return code. The return code is automatically returned
	 * by <code>open</code> if block on open is enabled. For non-blocking
	 * opens, the return code needs to be retrieved manually using
	 * <code>getReturnCode</code>.
	 * 
	 * @param code
	 *            the return code
	 */
	protected void setReturnCode(int code) {
		returnCode = code;
	}
	/**
	 * Returns the monitor whose client area contains the given point. If no
	 * monitor contains the point, returns the monitor that is closest to the
	 * point. If this is ever made public, it should be moved into a separate
	 * utility class.
	 * 
	 * @param toSearch